Commit 9db50228 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Implement SetCurrentTransform() for bitmap render target.

parent c457d0f1
......@@ -31,6 +31,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
static const DWRITE_MATRIX identity =
{
1.0f, 0.0f,
0.0f, 1.0f,
0.0f, 0.0f
};
struct gdiinterop {
IDWriteGdiInterop IDWriteGdiInterop_iface;
IDWriteFactory *factory;
......@@ -171,8 +178,11 @@ static HRESULT WINAPI rendertarget_GetCurrentTransform(IDWriteBitmapRenderTarget
static HRESULT WINAPI rendertarget_SetCurrentTransform(IDWriteBitmapRenderTarget *iface, DWRITE_MATRIX const *transform)
{
struct rendertarget *This = impl_from_IDWriteBitmapRenderTarget(iface);
FIXME("(%p)->(%p): stub\n", This, transform);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, transform);
This->m = transform ? *transform : identity;
return S_OK;
}
static HRESULT WINAPI rendertarget_GetSize(IDWriteBitmapRenderTarget *iface, SIZE *size)
......@@ -233,9 +243,7 @@ static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWrite
return hr;
}
target->m.m11 = target->m.m22 = 1.0;
target->m.m12 = target->m.m21 = 0.0;
target->m.dx = target->m.dy = 0.0;
target->m = identity;
target->pixels_per_dip = 1.0;
*ret = &target->IDWriteBitmapRenderTarget_iface;
......
......@@ -666,6 +666,25 @@ if (0) /* crashes on native */
ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
memset(&m, 0, sizeof(m));
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, &m);
ok(hr == S_OK, "got 0x%08x\n", hr);
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(m.m11 == 0.0 && m.m22 == 0.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
hr = IDWriteBitmapRenderTarget_SetCurrentTransform(target, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
memset(&m, 0xcc, sizeof(m));
hr = IDWriteBitmapRenderTarget_GetCurrentTransform(target, &m);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(m.m11 == 1.0 && m.m22 == 1.0 && m.m12 == 0.0 && m.m21 == 0.0, "got %.1f,%.1f,%.1f,%.1f\n", m.m11, m.m22, m.m12, m.m21);
ok(m.dx == 0.0 && m.dy == 0.0, "got %.1f,%.1f\n", m.dx, m.dy);
/* pixels per dip */
pdip = IDWriteBitmapRenderTarget_GetPixelsPerDip(target);
ok(pdip == 1.0, "got %.2f\n", pdip);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment