d2d1: Take the source transformation into account when creating a transformed geometry.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-02-03 13:37:12 +01:00 committed by Alexandre Julliard
parent 7ed032a014
commit d10dfd4102
3 changed files with 11 additions and 5 deletions

View File

@ -366,6 +366,7 @@ struct d2d_geometry
struct
{
ID2D1Geometry *src_geometry;
D2D_MATRIX_3X2_F transform;
} transformed;
} u;
};

View File

@ -3090,7 +3090,7 @@ static void STDMETHODCALLTYPE d2d_transformed_geometry_GetTransform(ID2D1Transfo
TRACE("iface %p, transform %p.\n", iface, transform);
*transform = geometry->transform;
*transform = geometry->u.transformed.transform;
}
static const struct ID2D1TransformedGeometryVtbl d2d_transformed_geometry_vtbl =
@ -3120,10 +3120,15 @@ void d2d_transformed_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *
ID2D1Geometry *src_geometry, const D2D_MATRIX_3X2_F *transform)
{
struct d2d_geometry *src_impl;
D2D_MATRIX_3X2_F g;
d2d_geometry_init(geometry, factory, transform, (ID2D1GeometryVtbl *)&d2d_transformed_geometry_vtbl);
ID2D1Geometry_AddRef(geometry->u.transformed.src_geometry = src_geometry);
src_impl = unsafe_impl_from_ID2D1Geometry(src_geometry);
g = src_impl->transform;
d2d_matrix_multiply(&g, transform);
d2d_geometry_init(geometry, factory, &g, (ID2D1GeometryVtbl *)&d2d_transformed_geometry_vtbl);
ID2D1Geometry_AddRef(geometry->u.transformed.src_geometry = src_geometry);
geometry->u.transformed.transform = *transform;
geometry->fill = src_impl->fill;
geometry->outline = src_impl->outline;
}

View File

@ -3817,7 +3817,7 @@ static void test_draw_geometry(void)
"ATNaJogBM2IlgAEzayV4M3MlbzN8JWczhAElXjONASVWM5UBJU0zngElRTOmASU8M68BJTQztgEm"
"KzO/ASUkM8cBJRsz0AElEzPYASUKM+EBJQIz6QFR8gFJ+gFAgwI4igIwkwIomwIfpAIXrAIOtQIG"
"8XYA");
todo_wine ok(match, "Figure does not match.\n");
ok(match, "Figure does not match.\n");
match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 32,
"ujEBngECnQEDnQEEmwEFmgEHmQEHmAEIlwEKlgEKlQELlAENkwENkgEOkQEQjwERjwESjQETjAEU"
"jAEKAQqKAQoCCokBCgMKiQEKBAqHAQoFCoYBCgYKhgEKBwqEAQoICoMBCgkKgwEKCgqBAQoLCoAB"
@ -3836,7 +3836,7 @@ static void test_draw_geometry(void)
"ChcKdQoWCncKFAp4ChQKeAoTCnoKEQp7ChALewoQCn0KDgp+Cg0LfgoNCoABCgsKgQEKCgqDAQoJ"
"CoMBCggKhAEKBwqGAQoGCoYBCgUKhwEKBAqJAQoDCokBCgIKigEKAQqMARSMARONARKPARGPARCR"
"AQ6SAQ2TAQ2UAQuVAQqWAQqXAQiYAQeZAQeaAQWbAQSdAQOdAQKeAQG6MQAA");
todo_wine ok(match, "Figure does not match.\n");
ok(match, "Figure does not match.\n");
match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 64,
"82ICvQIEugIHuAIJtgIKtAINsgIPsAIRrQITrAIVqQIYpwIZpgIbowIeoQIgnwIhnQIkmwImmAIp"
"lgIVARSVAhUDFJICFQUVkAIVBxSPAhUJFIwCFQwUigIVDRWHAhYPFIYCFRIUhAIVFBSBAhUWFf8B"