Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/d2d1_private.h | 2 +- dlls/d2d1/device.c | 576 ++++++++++++++++++++++++++++++--------- 2 files changed, 443 insertions(+), 135 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 925fcf48ce..5898302a90 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -119,7 +119,7 @@ struct d2d_ps_cb
struct d2d_d3d_render_target { - ID2D1RenderTarget ID2D1RenderTarget_iface; + ID2D1DeviceContext ID2D1DeviceContext_iface; ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface; IDWriteTextRenderer IDWriteTextRenderer_iface; LONG refcount; diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index cb7e8a540a..030889aa2d 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -193,22 +193,28 @@ static void d2d_rt_draw(struct d2d_d3d_render_target *render_target, enum d2d_sh WARN("Failed to apply stateblock, hr %#x.\n", hr); }
+static inline struct d2d_d3d_render_target *impl_from_ID2D1DeviceContext(ID2D1DeviceContext *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, ID2D1DeviceContext_iface); +} + static inline struct d2d_d3d_render_target *impl_from_ID2D1RenderTarget(ID2D1RenderTarget *iface) { - return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, ID2D1RenderTarget_iface); + return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, ID2D1DeviceContext_iface); }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_QueryInterface(ID2D1RenderTarget *iface, REFIID iid, void **out) +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_QueryInterface(ID2D1DeviceContext *iface, REFIID iid, void **out) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
- if (IsEqualGUID(iid, &IID_ID2D1RenderTarget) + if (IsEqualGUID(iid, &IID_ID2D1DeviceContext) + || IsEqualGUID(iid, &IID_ID2D1RenderTarget) || IsEqualGUID(iid, &IID_ID2D1Resource) || IsEqualGUID(iid, &IID_IUnknown)) { - ID2D1RenderTarget_AddRef(iface); + ID2D1DeviceContext_AddRef(iface); *out = iface; return S_OK; } @@ -225,9 +231,9 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_QueryInterface(ID2D1Rende return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_AddRef(ID2D1RenderTarget *iface) +static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_AddRef(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ULONG refcount = InterlockedIncrement(&render_target->refcount);
TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -235,9 +241,9 @@ static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_AddRef(ID2D1RenderTarget *i return refcount; }
-static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_Release(ID2D1RenderTarget *iface) +static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_Release(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ULONG refcount = InterlockedDecrement(&render_target->refcount);
TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -270,9 +276,9 @@ static ULONG STDMETHODCALLTYPE d2d_d3d_render_target_Release(ID2D1RenderTarget * return refcount; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_GetFactory(ID2D1RenderTarget *iface, ID2D1Factory **factory) +static void STDMETHODCALLTYPE d2d_d3d_render_target_GetFactory(ID2D1DeviceContext *iface, ID2D1Factory **factory) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, factory %p.\n", iface, factory);
@@ -280,10 +286,10 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_GetFactory(ID2D1RenderTarget ID2D1Factory_AddRef(*factory); }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmap(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmap(ID2D1DeviceContext *iface, D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_bitmap *object; HRESULT hr;
@@ -296,10 +302,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmap(ID2D1RenderT return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap(ID2D1DeviceContext *iface, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_bitmap *object; HRESULT hr;
@@ -313,27 +319,27 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1DeviceContext *iface, REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_bitmap *object; HRESULT hr;
TRACE("iface %p, iid %s, data %p, desc %p, bitmap %p.\n", iface, debugstr_guid(iid), data, desc, bitmap);
- if (SUCCEEDED(hr = d2d_bitmap_create_shared(iface, render_target->device, iid, data, desc, &object))) + if (SUCCEEDED(hr = d2d_bitmap_create_shared((ID2D1RenderTarget *)iface, render_target->device, iid, data, desc, &object))) *bitmap = (ID2D1Bitmap *)&object->ID2D1Bitmap1_iface;
return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1BitmapBrush **brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *object; HRESULT hr;
@@ -346,10 +352,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1Re return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2D1DeviceContext *iface, const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc, ID2D1SolidColorBrush **brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *object; HRESULT hr;
@@ -361,11 +367,11 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2 return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollection(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollection(ID2D1DeviceContext *iface, const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, ID2D1GradientStopCollection **gradient) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_gradient *object; HRESULT hr;
@@ -379,11 +385,11 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollect return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush(ID2D1DeviceContext *iface, const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, ID2D1LinearGradientBrush **brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *object; HRESULT hr;
@@ -397,11 +403,11 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateRadialGradientBrush(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateRadialGradientBrush(ID2D1DeviceContext *iface, const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, ID2D1RadialGradientBrush **brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *object; HRESULT hr;
@@ -415,11 +421,11 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateRadialGradientBrush return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateCompatibleRenderTarget(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateCompatibleRenderTarget(ID2D1DeviceContext *iface, const D2D1_SIZE_F *size, const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *format, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, ID2D1BitmapRenderTarget **rt) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_bitmap_render_target *object; HRESULT hr;
@@ -443,10 +449,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateCompatibleRenderTar return S_OK; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLayer(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLayer(ID2D1DeviceContext *iface, const D2D1_SIZE_F *size, ID2D1Layer **layer) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_layer *object; HRESULT hr;
@@ -458,9 +464,9 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLayer(ID2D1RenderTa return hr; }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1RenderTarget *iface, ID2D1Mesh **mesh) +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1DeviceContext *iface, ID2D1Mesh **mesh) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_mesh *object; HRESULT hr;
@@ -472,10 +478,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1RenderTar return hr; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1DeviceContext *iface, D2D1_POINT_2F p0, D2D1_POINT_2F p1, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1PathGeometry *geometry; ID2D1GeometrySink *sink; HRESULT hr; @@ -503,14 +509,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1RenderTarget * WARN("Close() failed, %#x.\n", hr); ID2D1GeometrySink_Release(sink);
- ID2D1RenderTarget_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); + ID2D1DeviceContext_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); ID2D1PathGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRectangle(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRectangle(ID2D1DeviceContext *iface, const D2D1_RECT_F *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1RectangleGeometry *geometry; HRESULT hr;
@@ -523,14 +529,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRectangle(ID2D1RenderTar return; }
- ID2D1RenderTarget_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); + ID2D1DeviceContext_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); ID2D1RectangleGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1DeviceContext *iface, const D2D1_RECT_F *rect, ID2D1Brush *brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1RectangleGeometry *geometry; HRESULT hr;
@@ -542,14 +548,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar return; }
- ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1DeviceContext_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); ID2D1RectangleGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRoundedRectangle(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRoundedRectangle(ID2D1DeviceContext *iface, const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1RoundedRectangleGeometry *geometry; HRESULT hr;
@@ -562,14 +568,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawRoundedRectangle(ID2D1Re return; }
- ID2D1RenderTarget_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); + ID2D1DeviceContext_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); ID2D1RoundedRectangleGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRoundedRectangle(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRoundedRectangle(ID2D1DeviceContext *iface, const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1RoundedRectangleGeometry *geometry; HRESULT hr;
@@ -581,14 +587,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRoundedRectangle(ID2D1Re return; }
- ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1DeviceContext_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); ID2D1RoundedRectangleGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawEllipse(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawEllipse(ID2D1DeviceContext *iface, const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1EllipseGeometry *geometry; HRESULT hr;
@@ -601,14 +607,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawEllipse(ID2D1RenderTarge return; }
- ID2D1RenderTarget_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); + ID2D1DeviceContext_DrawGeometry(iface, (ID2D1Geometry *)geometry, brush, stroke_width, stroke_style); ID2D1EllipseGeometry_Release(geometry); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillEllipse(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillEllipse(ID2D1DeviceContext *iface, const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); ID2D1EllipseGeometry *geometry; HRESULT hr;
@@ -620,7 +626,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillEllipse(ID2D1RenderTarge return; }
- ID2D1RenderTarget_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); + ID2D1DeviceContext_FillGeometry(iface, (ID2D1Geometry *)geometry, brush, NULL); ID2D1EllipseGeometry_Release(geometry); }
@@ -755,11 +761,11 @@ done: ID3D10Buffer_Release(vs_cb); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1DeviceContext *iface, ID2D1Geometry *geometry, ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) { const struct d2d_geometry *geometry_impl = unsafe_impl_from_ID2D1Geometry(geometry); - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *brush_impl = unsafe_impl_from_ID2D1Brush(brush);
TRACE("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p.\n", @@ -889,12 +895,12 @@ done: ID3D10Buffer_Release(vs_cb); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1DeviceContext *iface, ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacity_brush) { const struct d2d_geometry *geometry_impl = unsafe_impl_from_ID2D1Geometry(geometry); struct d2d_brush *opacity_brush_impl = unsafe_impl_from_ID2D1Brush(opacity_brush); - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_brush *brush_impl = unsafe_impl_from_ID2D1Brush(brush);
TRACE("iface %p, geometry %p, brush %p, opacity_brush %p.\n", iface, geometry, brush, opacity_brush); @@ -913,13 +919,13 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarg d2d_rt_fill_geometry(render_target, geometry_impl, brush_impl, opacity_brush_impl); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillMesh(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillMesh(ID2D1DeviceContext *iface, ID2D1Mesh *mesh, ID2D1Brush *brush) { FIXME("iface %p, mesh %p, brush %p stub!\n", iface, mesh, brush); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillOpacityMask(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_FillOpacityMask(ID2D1DeviceContext *iface, ID2D1Bitmap *mask, ID2D1Brush *brush, D2D1_OPACITY_MASK_CONTENT content, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect) { @@ -927,7 +933,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillOpacityMask(ID2D1RenderT iface, mask, brush, content, debug_d2d_rect_f(dst_rect), debug_d2d_rect_f(src_rect)); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawBitmap(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawBitmap(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, const D2D1_RECT_F *dst_rect, float opacity, D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode, const D2D1_RECT_F *src_rect) { @@ -979,21 +985,21 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawBitmap(ID2D1RenderTarget brush_desc.transform._22 = fabsf((d.bottom - d.top) / (s.bottom - s.top)); brush_desc.transform._32 = min(d.top, d.bottom) - min(s.top, s.bottom) * brush_desc.transform._22;
- if (FAILED(hr = ID2D1RenderTarget_CreateBitmapBrush(iface, bitmap, &bitmap_brush_desc, &brush_desc, &brush))) + if (FAILED(hr = ID2D1RenderTarget_CreateBitmapBrush((ID2D1RenderTarget *)iface, bitmap, &bitmap_brush_desc, &brush_desc, &brush))) { ERR("Failed to create bitmap brush, hr %#x.\n", hr); return; }
- ID2D1RenderTarget_FillRectangle(iface, &d, (ID2D1Brush *)brush); + ID2D1DeviceContext_FillRectangle(iface, &d, (ID2D1Brush *)brush); ID2D1BitmapBrush_Release(brush); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawText(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawText(ID2D1DeviceContext *iface, const WCHAR *string, UINT32 string_len, IDWriteTextFormat *text_format, const D2D1_RECT_F *layout_rect, ID2D1Brush *brush, D2D1_DRAW_TEXT_OPTIONS options, DWRITE_MEASURING_MODE measuring_mode) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); IDWriteTextLayout *text_layout; IDWriteFactory *dwrite_factory; D2D1_POINT_2F origin; @@ -1026,14 +1032,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawText(ID2D1RenderTarget * }
d2d_point_set(&origin, layout_rect->left, layout_rect->top); - ID2D1RenderTarget_DrawTextLayout(iface, origin, text_layout, brush, options); + ID2D1DeviceContext_DrawTextLayout(iface, origin, text_layout, brush, options); IDWriteTextLayout_Release(text_layout); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawTextLayout(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawTextLayout(ID2D1DeviceContext *iface, D2D1_POINT_2F origin, IDWriteTextLayout *layout, ID2D1Brush *brush, D2D1_DRAW_TEXT_OPTIONS options) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); struct d2d_draw_text_layout_ctx ctx; HRESULT hr;
@@ -1196,7 +1202,7 @@ static void d2d_rt_draw_glyph_run_bitmap(struct d2d_d3d_render_target *render_ta if (texture_type == DWRITE_TEXTURE_CLEARTYPE_3x1) bitmap_desc.dpiX *= 3.0f; bitmap_desc.dpiY = render_target->desc.dpiY; - if (FAILED(hr = d2d_d3d_render_target_CreateBitmap(&render_target->ID2D1RenderTarget_iface, + if (FAILED(hr = d2d_d3d_render_target_CreateBitmap(&render_target->ID2D1DeviceContext_iface, bitmap_size, opacity_values, bitmap_size.width, &bitmap_desc, &opacity_bitmap))) { ERR("Failed to create opacity bitmap, hr %#x.\n", hr); @@ -1213,7 +1219,7 @@ static void d2d_rt_draw_glyph_run_bitmap(struct d2d_d3d_render_target *render_ta brush_desc.transform._22 = 1.0f; brush_desc.transform._31 = run_rect.left; brush_desc.transform._32 = run_rect.top; - if (FAILED(hr = d2d_d3d_render_target_CreateBitmapBrush(&render_target->ID2D1RenderTarget_iface, + if (FAILED(hr = d2d_d3d_render_target_CreateBitmapBrush(&render_target->ID2D1DeviceContext_iface, opacity_bitmap, NULL, &brush_desc, &opacity_brush))) { ERR("Failed to create opacity bitmap brush, hr %#x.\n", hr); @@ -1243,11 +1249,11 @@ done: IDWriteGlyphRunAnalysis_Release(analysis); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGlyphRun(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGlyphRun(ID2D1DeviceContext *iface, D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); DWRITE_TEXT_ANTIALIAS_MODE antialias_mode = DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE; IDWriteRenderingParams *rendering_params; DWRITE_RENDERING_MODE rendering_mode; @@ -1325,68 +1331,68 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGlyphRun(ID2D1RenderTarg rendering_mode, measuring_mode, antialias_mode); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTransform(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTransform(ID2D1DeviceContext *iface, const D2D1_MATRIX_3X2_F *transform) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, transform %p.\n", iface, transform);
render_target->drawing_state.transform = *transform; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTransform(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTransform(ID2D1DeviceContext *iface, D2D1_MATRIX_3X2_F *transform) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, transform %p.\n", iface, transform);
*transform = render_target->drawing_state.transform; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetAntialiasMode(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetAntialiasMode(ID2D1DeviceContext *iface, D2D1_ANTIALIAS_MODE antialias_mode) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, antialias_mode %#x stub!\n", iface, antialias_mode);
render_target->drawing_state.antialiasMode = antialias_mode; }
-static D2D1_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_d3d_render_target_GetAntialiasMode(ID2D1RenderTarget *iface) +static D2D1_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_d3d_render_target_GetAntialiasMode(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p.\n", iface);
return render_target->drawing_state.antialiasMode; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTextAntialiasMode(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTextAntialiasMode(ID2D1DeviceContext *iface, D2D1_TEXT_ANTIALIAS_MODE antialias_mode) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, antialias_mode %#x.\n", iface, antialias_mode);
render_target->drawing_state.textAntialiasMode = antialias_mode; }
-static D2D1_TEXT_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_d3d_render_target_GetTextAntialiasMode(ID2D1RenderTarget *iface) +static D2D1_TEXT_ANTIALIAS_MODE STDMETHODCALLTYPE d2d_d3d_render_target_GetTextAntialiasMode(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p.\n", iface);
return render_target->drawing_state.textAntialiasMode; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTextRenderingParams(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTextRenderingParams(ID2D1DeviceContext *iface, IDWriteRenderingParams *text_rendering_params) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params);
@@ -1397,10 +1403,10 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTextRenderingParams(ID2D1 render_target->text_rendering_params = text_rendering_params; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTextRenderingParams(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTextRenderingParams(ID2D1DeviceContext *iface, IDWriteRenderingParams **text_rendering_params) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params);
@@ -1408,9 +1414,9 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTextRenderingParams(ID2D1 IDWriteRenderingParams_AddRef(*text_rendering_params); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTags(ID2D1RenderTarget *iface, D2D1_TAG tag1, D2D1_TAG tag2) +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTags(ID2D1DeviceContext *iface, D2D1_TAG tag1, D2D1_TAG tag2) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, tag1 %s, tag2 %s.\n", iface, wine_dbgstr_longlong(tag1), wine_dbgstr_longlong(tag2));
@@ -1418,9 +1424,9 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTags(ID2D1RenderTarget *i render_target->drawing_state.tag2 = tag2; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTags(ID2D1RenderTarget *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) +static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTags(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
@@ -1428,29 +1434,29 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_GetTags(ID2D1RenderTarget *i *tag2 = render_target->drawing_state.tag2; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_PushLayer(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_PushLayer(ID2D1DeviceContext *iface, const D2D1_LAYER_PARAMETERS *layer_parameters, ID2D1Layer *layer) { FIXME("iface %p, layer_parameters %p, layer %p stub!\n", iface, layer_parameters, layer); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_PopLayer(ID2D1RenderTarget *iface) +static void STDMETHODCALLTYPE d2d_d3d_render_target_PopLayer(ID2D1DeviceContext *iface) { FIXME("iface %p stub!\n", iface); }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_Flush(ID2D1RenderTarget *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_Flush(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) { FIXME("iface %p, tag1 %p, tag2 %p stub!\n", iface, tag1, tag2);
return E_NOTIMPL; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SaveDrawingState(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_SaveDrawingState(ID2D1DeviceContext *iface, ID2D1DrawingStateBlock *state_block) { struct d2d_state_block *state_block_impl = unsafe_impl_from_ID2D1DrawingStateBlock(state_block); - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, state_block %p.\n", iface, state_block);
@@ -1462,11 +1468,11 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SaveDrawingState(ID2D1Render state_block_impl->text_rendering_params = render_target->text_rendering_params; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_RestoreDrawingState(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_RestoreDrawingState(ID2D1DeviceContext *iface, ID2D1DrawingStateBlock *state_block) { struct d2d_state_block *state_block_impl = unsafe_impl_from_ID2D1DrawingStateBlock(state_block); - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, state_block %p.\n", iface, state_block);
@@ -1478,10 +1484,10 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_RestoreDrawingState(ID2D1Ren render_target->text_rendering_params = state_block_impl->text_rendering_params; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_PushAxisAlignedClip(ID2D1RenderTarget *iface, +static void STDMETHODCALLTYPE d2d_d3d_render_target_PushAxisAlignedClip(ID2D1DeviceContext *iface, const D2D1_RECT_F *clip_rect, D2D1_ANTIALIAS_MODE antialias_mode) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); D2D1_RECT_F transformed_rect; float x_scale, y_scale; D2D1_POINT_2F point; @@ -1510,18 +1516,18 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_PushAxisAlignedClip(ID2D1Ren WARN("Failed to push clip rect.\n"); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_PopAxisAlignedClip(ID2D1RenderTarget *iface) +static void STDMETHODCALLTYPE d2d_d3d_render_target_PopAxisAlignedClip(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p.\n", iface);
d2d_clip_stack_pop(&render_target->clip_stack); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *iface, const D2D1_COLOR_F *colour) +static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1DeviceContext *iface, const D2D1_COLOR_F *colour) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface); D3D10_SUBRESOURCE_DATA buffer_data; struct d2d_ps_cb ps_cb_data = {0}; D3D10_BUFFER_DESC buffer_desc; @@ -1596,19 +1602,19 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *ifa ID3D10Buffer_Release(vs_cb); }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_BeginDraw(ID2D1RenderTarget *iface) +static void STDMETHODCALLTYPE d2d_d3d_render_target_BeginDraw(ID2D1DeviceContext *iface) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p.\n", iface);
memset(&render_target->error, 0, sizeof(render_target->error)); }
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_EndDraw(ID2D1RenderTarget *iface, +static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_EndDraw(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
@@ -1620,10 +1626,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_EndDraw(ID2D1RenderTarget return render_target->error.code; }
-static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelFormat(ID2D1RenderTarget *iface, +static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelFormat(ID2D1DeviceContext *iface, D2D1_PIXEL_FORMAT *format) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, format %p.\n", iface, format);
@@ -1631,9 +1637,9 @@ static D2D1_PIXEL_FORMAT * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelForma return format; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetDpi(ID2D1RenderTarget *iface, float dpi_x, float dpi_y) +static void STDMETHODCALLTYPE d2d_d3d_render_target_SetDpi(ID2D1DeviceContext *iface, float dpi_x, float dpi_y) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, dpi_x %.8e, dpi_y %.8e.\n", iface, dpi_x, dpi_y);
@@ -1649,9 +1655,9 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_SetDpi(ID2D1RenderTarget *if render_target->desc.dpiY = dpi_y; }
-static void STDMETHODCALLTYPE d2d_d3d_render_target_GetDpi(ID2D1RenderTarget *iface, float *dpi_x, float *dpi_y) +static void STDMETHODCALLTYPE d2d_d3d_render_target_GetDpi(ID2D1DeviceContext *iface, float *dpi_x, float *dpi_y) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
@@ -1659,9 +1665,9 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_GetDpi(ID2D1RenderTarget *if *dpi_y = render_target->desc.dpiY; }
-static D2D1_SIZE_F * STDMETHODCALLTYPE d2d_d3d_render_target_GetSize(ID2D1RenderTarget *iface, D2D1_SIZE_F *size) +static D2D1_SIZE_F * STDMETHODCALLTYPE d2d_d3d_render_target_GetSize(ID2D1DeviceContext *iface, D2D1_SIZE_F *size) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, size %p.\n", iface, size);
@@ -1670,10 +1676,10 @@ static D2D1_SIZE_F * STDMETHODCALLTYPE d2d_d3d_render_target_GetSize(ID2D1Render return size; }
-static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelSize(ID2D1RenderTarget *iface, +static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelSize(ID2D1DeviceContext *iface, D2D1_SIZE_U *pixel_size) { - struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_d3d_render_target *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, pixel_size %p.\n", iface, pixel_size);
@@ -1681,14 +1687,14 @@ static D2D1_SIZE_U * STDMETHODCALLTYPE d2d_d3d_render_target_GetPixelSize(ID2D1R return pixel_size; }
-static UINT32 STDMETHODCALLTYPE d2d_d3d_render_target_GetMaximumBitmapSize(ID2D1RenderTarget *iface) +static UINT32 STDMETHODCALLTYPE d2d_d3d_render_target_GetMaximumBitmapSize(ID2D1DeviceContext *iface) { FIXME("iface %p stub!\n", iface);
return 0; }
-static BOOL STDMETHODCALLTYPE d2d_d3d_render_target_IsSupported(ID2D1RenderTarget *iface, +static BOOL STDMETHODCALLTYPE d2d_d3d_render_target_IsSupported(ID2D1DeviceContext *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc) { FIXME("iface %p, desc %p stub!\n", iface, desc); @@ -1696,7 +1702,274 @@ static BOOL STDMETHODCALLTYPE d2d_d3d_render_target_IsSupported(ID2D1RenderTarge return FALSE; }
-static const struct ID2D1RenderTargetVtbl d2d_d3d_render_target_vtbl = +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmap(ID2D1DeviceContext *iface, D2D1_SIZE_U size, + const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p stub!\n", iface, size.width, size.height, + src_data, pitch, desc, bitmap); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromWicBitmap(ID2D1DeviceContext *iface, + IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, bitmap_source %p, desc %p, bitmap %p stub!\n", iface, bitmap_source, desc, bitmap); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContext(ID2D1DeviceContext *iface, D2D1_COLOR_SPACE space, + const BYTE *profile, UINT32 profile_size, ID2D1ColorContext **color_context) +{ + FIXME("iface %p, space %d, profile %p, profile_size %u, color_context %p stub!\n", iface, space, profile, + profile_size, color_context); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromFilename(ID2D1DeviceContext *iface, + const WCHAR *filename, ID2D1ColorContext **color_context) +{ + FIXME("iface %p, filename %s, color_context %p stub!\n", iface, debugstr_w(filename), color_context); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateColorContextFromWicColorContext(ID2D1DeviceContext *iface, + IWICColorContext *wic_color_context, ID2D1ColorContext **color_context) +{ + FIXME("iface %p, wic_color_context %p, color_context %p stub!\n", iface, wic_color_context, color_context); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapFromDxgiSurface(ID2D1DeviceContext *iface, + IDXGISurface *surface, const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, surface %p, desc %p, bitmap %p stub!\n", iface, surface, desc, bitmap); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceContext *iface, REFCLSID effect_id, + ID2D1Effect **effect) +{ + FIXME("iface %p, effect_id %s, effect %p stub!\n", iface, debugstr_guid(effect_id), effect); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateGradientStopCollection(ID2D1DeviceContext *iface, + const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_COLOR_SPACE preinterpolation_space, + D2D1_COLOR_SPACE postinterpolation_space, D2D1_BUFFER_PRECISION buffer_precision, D2D1_EXTEND_MODE extend_mode, + D2D1_COLOR_INTERPOLATION_MODE color_interpolation_mode, ID2D1GradientStopCollection1 **gradient) +{ + FIXME("iface %p, stops %p, stop_count %u, preinterpolation_space %d, postinterpolation_space %d, " + "buffer_precision %d, extend_mode %d, color_interpolation_mode %d, gradient %p stub!\n", iface, stops, + stop_count, preinterpolation_space, postinterpolation_space, buffer_precision, extend_mode, + color_interpolation_mode, gradient); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateImageBrush(ID2D1DeviceContext *iface, ID2D1Image *image, + const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, + ID2D1ImageBrush **brush) +{ + FIXME("iface %p, image %p, image_brush_desc %p, brush_desc %p, brush %p stub!\n", iface, image, image_brush_desc, + brush_desc, brush); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateBitmapBrush(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, + const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, + ID2D1BitmapBrush1 **bitmap_brush) +{ + FIXME("iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, bitmap_brush %p stub!\n", iface, bitmap, + bitmap_brush_desc, brush_desc, bitmap_brush); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateCommandList(ID2D1DeviceContext *iface, + ID2D1CommandList **command_list) +{ + FIXME("iface %p, command_list %p stub!\n", iface, command_list); + + return E_NOTIMPL; +} + +static BOOL STDMETHODCALLTYPE d2d_device_context_IsDxgiFormatSupported(ID2D1DeviceContext *iface, DXGI_FORMAT format) +{ + FIXME("iface %p, format %d stub!\n", iface, format); + + return FALSE; +} + +static BOOL STDMETHODCALLTYPE d2d_device_context_IsBufferPrecisionSupported(ID2D1DeviceContext *iface, + D2D1_BUFFER_PRECISION buffer_precision) +{ + FIXME("iface %p, buffer_precision %d stub!\n", iface, buffer_precision); + + return FALSE; +} + +static void STDMETHODCALLTYPE d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext *iface, ID2D1Image *image, + D2D1_RECT_F *local_bounds) +{ + FIXME("iface %p, image %p, local_bounds %p stub!\n", iface, image, local_bounds); +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_GetImageWorldBounds(ID2D1DeviceContext *iface, ID2D1Image *image, + D2D1_RECT_F *world_bounds) +{ + FIXME("iface %p, image %p, world_bounds %p stub!\n", iface, image, world_bounds); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_GetGlyphRunWorldBounds(ID2D1DeviceContext *iface, + D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, DWRITE_MEASURING_MODE measuring_mode, + D2D1_RECT_F *bounds) +{ + FIXME("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, measuring_mode %d, bounds %p stub!\n", iface, + baseline_origin.x, baseline_origin.y, glyph_run, measuring_mode, bounds); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d2d_device_context_GetDevice(ID2D1DeviceContext *iface, ID2D1Device **device) +{ + FIXME("iface %p, device %p stub!\n", iface, device); +} + +static void STDMETHODCALLTYPE d2d_device_context_SetTarget(ID2D1DeviceContext *iface, ID2D1Image *target) +{ + FIXME("iface %p, target %p stub!\n", iface, target); +} + +static void STDMETHODCALLTYPE d2d_device_context_GetTarget(ID2D1DeviceContext *iface, ID2D1Image **target) +{ + FIXME("iface %p, target %p stub!\n", iface, target); +} + +static void STDMETHODCALLTYPE d2d_device_context_SetRenderingControls(ID2D1DeviceContext *iface, + const D2D1_RENDERING_CONTROLS *rendering_controls) +{ + FIXME("iface %p, rendering_controls %p stub!\n", iface, rendering_controls); +} + +static void STDMETHODCALLTYPE d2d_device_context_GetRenderingControls(ID2D1DeviceContext *iface, + D2D1_RENDERING_CONTROLS *rendering_controls) +{ + FIXME("iface %p, rendering_controls %p stub!\n", iface, rendering_controls); +} + +static void STDMETHODCALLTYPE d2d_device_context_SetPrimitiveBlend(ID2D1DeviceContext *iface, + D2D1_PRIMITIVE_BLEND primitive_blend) +{ + FIXME("iface %p, primitive_blend %d stub!\n", iface, primitive_blend); +} + +static D2D1_PRIMITIVE_BLEND STDMETHODCALLTYPE d2d_device_context_GetPrimitiveBlend(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_PRIMITIVE_BLEND_SOURCE_OVER; +} + +static void STDMETHODCALLTYPE d2d_device_context_SetUnitMode(ID2D1DeviceContext *iface, D2D1_UNIT_MODE unit_mode) +{ + FIXME("iface %p, unit_mode %d stub!\n", iface, unit_mode); +} + +static D2D1_UNIT_MODE STDMETHODCALLTYPE d2d_device_context_GetUnitMode(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + + return D2D1_UNIT_MODE_DIPS; +} + +static void STDMETHODCALLTYPE d2d_device_context_DrawGlyphRun(ID2D1DeviceContext *iface, D2D1_POINT_2F baseline_origin, + const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, ID2D1Brush *brush, + DWRITE_MEASURING_MODE measuring_mode) +{ + FIXME("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, glyph_run_desc %p, brush %p, measuring_mode %d stub!\n", + iface, baseline_origin.x, baseline_origin.y, glyph_run, glyph_run_desc, brush, measuring_mode); +} + +static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext *iface, ID2D1Image *image, + const D2D1_POINT_2F *target_offset, const D2D1_RECT_F *image_rect, D2D1_INTERPOLATION_MODE interpolation_mode, + D2D1_COMPOSITE_MODE composite_mode) +{ + FIXME("iface %p, image %p, target_offset %p, image_rect %p, interpolation_mode %d, composite_mode %d stub!\n", iface, + image, target_offset, image_rect, interpolation_mode, composite_mode); +} + +static void STDMETHODCALLTYPE d2d_device_context_DrawGdiMetafile(ID2D1DeviceContext *iface, ID2D1GdiMetafile *metafile, + const D2D1_POINT_2F *target_offset) +{ + FIXME("iface %p, metafile %p, target_offset %p stub!\n", iface, metafile, target_offset); +} + +static void STDMETHODCALLTYPE d2d_device_context_DrawBitmap(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, + const D2D1_RECT_F *dst_rect, float opacity, D2D1_INTERPOLATION_MODE interpolation_mode, + const D2D1_RECT_F *src_rect, const D2D1_MATRIX_4X4_F *perspective_transform) +{ + FIXME("iface %p, bitmap %p, dst_rect %p, opacity %.8e, interpolation_mode %d, src_rect %p, perspective_transform %p stub!\n", + iface, bitmap, dst_rect, opacity, interpolation_mode, src_rect, perspective_transform); +} + +static void STDMETHODCALLTYPE d2d_device_context_PushLayer(ID2D1DeviceContext *iface, + const D2D1_LAYER_PARAMETERS1 *layer_parameters, ID2D1Layer *layer) +{ + FIXME("iface %p, layer_parameters %p, layer %p stub!\n", iface, layer_parameters, layer); +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_InvalidateEffectInputRectangle(ID2D1DeviceContext *iface, + ID2D1Effect *effect, UINT32 input, const D2D1_RECT_F *input_rect) +{ + FIXME("iface %p, effect %p, input %u, input_rect %s stub!\n", iface, effect, input, debug_d2d_rect_f(input_rect)); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectInvalidRectangleCount(ID2D1DeviceContext *iface, + ID2D1Effect *effect, UINT32 *rect_count) +{ + FIXME("iface %p, effect %p, rect_count %p stub!\n", iface, effect, rect_count); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectInvalidRectangles(ID2D1DeviceContext *iface, + ID2D1Effect *effect, D2D1_RECT_F *rectangles, UINT32 rect_count) +{ + FIXME("iface %p, effect %p, rectangles %p, rect_count %u stub!\n", iface, effect, rectangles, rect_count); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d2d_device_context_GetEffectRequiredInputRectangles(ID2D1DeviceContext *iface, + ID2D1Effect *effect, const D2D1_RECT_F *image_rect, const D2D1_EFFECT_INPUT_DESCRIPTION *desc, + D2D1_RECT_F *input_rect, UINT32 input_count) +{ + FIXME("iface %p, effect %p, image_rect %s, desc %p, input_rect %p, input_count %u stub!\n", iface, effect, + debug_d2d_rect_f(image_rect), desc, input_rect, input_count); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d2d_device_context_FillOpacityMask(ID2D1DeviceContext *iface, ID2D1Bitmap *mask, + ID2D1Brush *brush, const D2D1_RECT_F *dst_rect, const D2D1_RECT_F *src_rect) +{ + FIXME("iface %p, mask %p, brush %p, dst_rect %s, src_rect %s stub!\n", iface, mask, brush, + debug_d2d_rect_f(dst_rect), debug_d2d_rect_f(src_rect)); +} + +static const struct ID2D1DeviceContextVtbl d2d_device_context_vtbl = { d2d_d3d_render_target_QueryInterface, d2d_d3d_render_target_AddRef, @@ -1755,6 +2028,41 @@ static const struct ID2D1RenderTargetVtbl d2d_d3d_render_target_vtbl = d2d_d3d_render_target_GetPixelSize, d2d_d3d_render_target_GetMaximumBitmapSize, d2d_d3d_render_target_IsSupported, + d2d_device_context_CreateBitmap, + d2d_device_context_CreateBitmapFromWicBitmap, + d2d_device_context_CreateColorContext, + d2d_device_context_CreateColorContextFromFilename, + d2d_device_context_CreateColorContextFromWicColorContext, + d2d_device_context_CreateBitmapFromDxgiSurface, + d2d_device_context_CreateEffect, + d2d_device_context_CreateGradientStopCollection, + d2d_device_context_CreateImageBrush, + d2d_device_context_CreateBitmapBrush, + d2d_device_context_CreateCommandList, + d2d_device_context_IsDxgiFormatSupported, + d2d_device_context_IsBufferPrecisionSupported, + d2d_device_context_GetImageLocalBounds, + d2d_device_context_GetImageWorldBounds, + d2d_device_context_GetGlyphRunWorldBounds, + d2d_device_context_GetDevice, + d2d_device_context_SetTarget, + d2d_device_context_GetTarget, + d2d_device_context_SetRenderingControls, + d2d_device_context_GetRenderingControls, + d2d_device_context_SetPrimitiveBlend, + d2d_device_context_GetPrimitiveBlend, + d2d_device_context_SetUnitMode, + d2d_device_context_GetUnitMode, + d2d_device_context_DrawGlyphRun, + d2d_device_context_DrawImage, + d2d_device_context_DrawGdiMetafile, + d2d_device_context_DrawBitmap, + d2d_device_context_PushLayer, + d2d_device_context_InvalidateEffectInputRectangle, + d2d_device_context_GetEffectInvalidRectangleCount, + d2d_device_context_GetEffectInvalidRectangles, + d2d_device_context_GetEffectRequiredInputRectangles, + d2d_device_context_FillOpacityMask, };
static inline struct d2d_d3d_render_target *impl_from_IDWriteTextRenderer(IDWriteTextRenderer *iface) @@ -1787,7 +2095,7 @@ static ULONG STDMETHODCALLTYPE d2d_text_renderer_AddRef(IDWriteTextRenderer *ifa
TRACE("iface %p.\n", iface);
- return d2d_d3d_render_target_AddRef(&render_target->ID2D1RenderTarget_iface); + return d2d_d3d_render_target_AddRef(&render_target->ID2D1DeviceContext_iface); }
static ULONG STDMETHODCALLTYPE d2d_text_renderer_Release(IDWriteTextRenderer *iface) @@ -1796,7 +2104,7 @@ static ULONG STDMETHODCALLTYPE d2d_text_renderer_Release(IDWriteTextRenderer *if
TRACE("iface %p.\n", iface);
- return d2d_d3d_render_target_Release(&render_target->ID2D1RenderTarget_iface); + return d2d_d3d_render_target_Release(&render_target->ID2D1DeviceContext_iface); }
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface, @@ -1818,7 +2126,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_GetCurrentTransform(IDWriteTe
TRACE("iface %p, ctx %p, transform %p.\n", iface, ctx, transform);
- ID2D1RenderTarget_GetTransform(&render_target->ID2D1RenderTarget_iface, (D2D1_MATRIX_3X2_F *)transform); + ID2D1DeviceContext_GetTransform(&render_target->ID2D1DeviceContext_iface, (D2D1_MATRIX_3X2_F *)transform);
return S_OK; } @@ -1920,7 +2228,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende color_brush = brush; else { - if (FAILED(hr = ID2D1RenderTarget_CreateSolidColorBrush(&render_target->ID2D1RenderTarget_iface, + if (FAILED(hr = ID2D1DeviceContext_CreateSolidColorBrush(&render_target->ID2D1DeviceContext_iface, &color_run->runColor, NULL, (ID2D1SolidColorBrush **)&color_brush))) { ERR("Failed to create solid color brush, hr %#x.\n", hr); @@ -1930,7 +2238,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende
origin.x = color_run->baselineOriginX; origin.y = color_run->baselineOriginY; - ID2D1RenderTarget_DrawGlyphRun(&render_target->ID2D1RenderTarget_iface, + ID2D1RenderTarget_DrawGlyphRun((ID2D1RenderTarget *)&render_target->ID2D1DeviceContext_iface, origin, &color_run->glyphRun, color_brush, measuring_mode);
if (color_brush != brush) @@ -1940,7 +2248,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende IDWriteColorGlyphRunEnumerator_Release(layers); } else - ID2D1RenderTarget_DrawGlyphRun(&render_target->ID2D1RenderTarget_iface, + ID2D1RenderTarget_DrawGlyphRun((ID2D1RenderTarget *)&render_target->ID2D1DeviceContext_iface, baseline_origin, glyph_run, brush, measuring_mode);
ID2D1Brush_Release(brush); @@ -1973,7 +2281,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRend end.x = start.x + underline->width; end.y = start.y; prev_antialias_mode = d2d_d3d_render_target_set_aa_mode_from_text_aa_mode(render_target); - d2d_d3d_render_target_DrawLine(&render_target->ID2D1RenderTarget_iface, start, end, brush, thickness, NULL); + d2d_d3d_render_target_DrawLine(&render_target->ID2D1DeviceContext_iface, start, end, brush, thickness, NULL); render_target->drawing_state.antialiasMode = prev_antialias_mode;
ID2D1Brush_Release(brush); @@ -2006,7 +2314,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawStrikethrough(IDWriteText end.x = start.x + strikethrough->width; end.y = start.y; prev_antialias_mode = d2d_d3d_render_target_set_aa_mode_from_text_aa_mode(render_target); - d2d_d3d_render_target_DrawLine(&render_target->ID2D1RenderTarget_iface, start, end, brush, thickness, NULL); + d2d_d3d_render_target_DrawLine(&render_target->ID2D1DeviceContext_iface, start, end, brush, thickness, NULL); render_target->drawing_state.antialiasMode = prev_antialias_mode;
ID2D1Brush_Release(brush); @@ -3032,7 +3340,7 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t if (desc->minLevel != D2D1_FEATURE_LEVEL_DEFAULT) WARN("Ignoring feature level %#x.\n", desc->minLevel);
- render_target->ID2D1RenderTarget_iface.lpVtbl = &d2d_d3d_render_target_vtbl; + render_target->ID2D1DeviceContext_iface.lpVtbl = &d2d_device_context_vtbl; render_target->ID2D1GdiInteropRenderTarget_iface.lpVtbl = &d2d_gdi_interop_render_target_vtbl; render_target->IDWriteTextRenderer_iface.lpVtbl = &d2d_text_renderer_vtbl; render_target->refcount = 1; @@ -3040,7 +3348,7 @@ static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_t ID2D1Factory_AddRef(render_target->factory);
render_target->outer_unknown = outer_unknown ? outer_unknown : - (IUnknown *)&render_target->ID2D1RenderTarget_iface; + (IUnknown *)&render_target->ID2D1DeviceContext_iface;
if (FAILED(hr = IDXGISurface_GetDevice(surface, &IID_ID3D10Device, (void **)&render_target->device))) { @@ -3255,7 +3563,7 @@ HRESULT d2d_d3d_create_render_target(ID2D1Factory *factory, IDXGISurface *surfac }
TRACE("Created render target %p.\n", object); - *render_target = &object->ID2D1RenderTarget_iface; + *render_target = (ID2D1RenderTarget *)&object->ID2D1DeviceContext_iface;
return S_OK; }