Commit 6dd11426 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

d2d1: Scale stroke width for D2D1_STROKE_TRANSFORM_TYPE_FIXED in…

d2d1: Scale stroke width for D2D1_STROKE_TRANSFORM_TYPE_FIXED in DrawGeometry::ID2D1DeviceContext1(). Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru>
parent cd3ebad1
...@@ -383,6 +383,7 @@ struct d2d_stroke_style ...@@ -383,6 +383,7 @@ struct d2d_stroke_style
HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory, HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory,
const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count); const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count);
struct d2d_stroke_style *unsafe_impl_from_ID2D1StrokeStyle(ID2D1StrokeStyle *iface);
struct d2d_layer struct d2d_layer
{ {
......
...@@ -942,6 +942,7 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGeometry(ID2D1DeviceContext ...@@ -942,6 +942,7 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGeometry(ID2D1DeviceContext
const struct d2d_geometry *geometry_impl = unsafe_impl_from_ID2D1Geometry(geometry); const struct d2d_geometry *geometry_impl = unsafe_impl_from_ID2D1Geometry(geometry);
struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface); struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
struct d2d_brush *brush_impl = unsafe_impl_from_ID2D1Brush(brush); struct d2d_brush *brush_impl = unsafe_impl_from_ID2D1Brush(brush);
struct d2d_stroke_style *stroke_style_impl = unsafe_impl_from_ID2D1StrokeStyle(stroke_style);
TRACE("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p.\n", TRACE("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p.\n",
iface, geometry, brush, stroke_width, stroke_style); iface, geometry, brush, stroke_width, stroke_style);
...@@ -956,6 +957,12 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGeometry(ID2D1DeviceContext ...@@ -956,6 +957,12 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawGeometry(ID2D1DeviceContext
if (stroke_style) if (stroke_style)
FIXME("Ignoring stroke style %p.\n", stroke_style); FIXME("Ignoring stroke style %p.\n", stroke_style);
if (stroke_style_impl)
{
if (stroke_style_impl->desc.transformType == D2D1_STROKE_TRANSFORM_TYPE_FIXED)
stroke_width /= context->drawing_state.transform.m11;
}
d2d_device_context_draw_geometry(context, geometry_impl, brush_impl, stroke_width); d2d_device_context_draw_geometry(context, geometry_impl, brush_impl, stroke_width);
} }
......
...@@ -191,6 +191,14 @@ static const struct ID2D1StrokeStyle1Vtbl d2d_stroke_style_vtbl = ...@@ -191,6 +191,14 @@ static const struct ID2D1StrokeStyle1Vtbl d2d_stroke_style_vtbl =
d2d_stroke_style_GetStrokeTransformType d2d_stroke_style_GetStrokeTransformType
}; };
struct d2d_stroke_style *unsafe_impl_from_ID2D1StrokeStyle(ID2D1StrokeStyle *iface)
{
if (!iface)
return NULL;
assert((const struct ID2D1StrokeStyle1Vtbl *)iface->lpVtbl == &d2d_stroke_style_vtbl);
return CONTAINING_RECORD(iface, struct d2d_stroke_style, ID2D1StrokeStyle1_iface);
}
HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory, HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory,
const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count) const D2D1_STROKE_STYLE_PROPERTIES1 *desc, const float *dashes, UINT32 dash_count)
{ {
......
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