From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d2d1/bitmap.c | 8 +-
dlls/d2d1/bitmap_render_target.c | 2 +-
dlls/d2d1/brush.c | 4 +-
dlls/d2d1/d2d1_private.h | 10 +-
dlls/d2d1/device.c | 786 +++++++++++++++++++++++++++------------
5 files changed, 563 insertions(+), 247 deletions(-)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index 2d27d7b799f..8282dca0435 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -337,7 +337,7 @@ HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE
return *bitmap ? S_OK : E_OUTOFMEMORY;
}
-HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device *target_device,
+HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *target_device,
REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap)
{
D2D1_BITMAP_PROPERTIES d;
@@ -349,7 +349,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
ID3D10Device *device;
HRESULT hr = S_OK;
- ID2D1RenderTarget_GetFactory(render_target, &factory);
+ ID2D1DeviceContext_GetFactory(context, &factory);
if (src_impl->factory != factory)
{
hr = D2DERR_WRONG_FACTORY;
@@ -437,7 +437,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
{
float dpi_x, dpi_y;
- ID2D1RenderTarget_GetDpi(render_target, &dpi_x, &dpi_y);
+ ID2D1DeviceContext_GetDpi(context, &dpi_x, &dpi_y);
if (d.dpiX == 0.0f)
d.dpiX = dpi_x;
if (d.dpiY == 0.0f)
@@ -454,7 +454,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
pixel_size.width = surface_desc.Width;
pixel_size.height = surface_desc.Height;
- ID2D1RenderTarget_GetFactory(render_target, &factory);
+ ID2D1DeviceContext_GetFactory(context, &factory);
d2d_bitmap_init(*bitmap, factory, view, pixel_size, &d);
ID3D10ShaderResourceView_Release(view);
ID2D1Factory_Release(factory);
diff --git a/dlls/d2d1/bitmap_render_target.c b/dlls/d2d1/bitmap_render_target.c
index de588723b7a..c106e211d61 100644
--- a/dlls/d2d1/bitmap_render_target.c
+++ b/dlls/d2d1/bitmap_render_target.c
@@ -728,7 +728,7 @@ static const struct ID2D1BitmapRenderTargetVtbl d2d_bitmap_render_target_vtbl =
};
HRESULT d2d_bitmap_render_target_init(struct d2d_bitmap_render_target *render_target,
- const struct d2d_d3d_render_target *parent_target, const D2D1_SIZE_F *size,
+ const struct d2d_device_context *parent_target, const D2D1_SIZE_F *size,
const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *pixel_format,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options)
{
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
index 00a37e6f12b..450507cef62 100644
--- a/dlls/d2d1/brush.c
+++ b/dlls/d2d1/brush.c
@@ -1087,7 +1087,7 @@ static D3D10_TEXTURE_ADDRESS_MODE texture_address_mode_from_extend_mode(D2D1_EXT
}
static BOOL d2d_brush_fill_cb(const struct d2d_brush *brush,
- const struct d2d_d3d_render_target *render_target, struct d2d_brush_cb *cb)
+ const struct d2d_device_context *render_target, struct d2d_brush_cb *cb)
{
float theta, sin_theta, cos_theta;
float dpi_scale, d, s1, s2, t, u;
@@ -1204,7 +1204,7 @@ static BOOL d2d_brush_fill_cb(const struct d2d_brush *brush,
}
HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush,
- BOOL outline, struct d2d_d3d_render_target *render_target, ID3D10Buffer **ps_cb)
+ BOOL outline, struct d2d_device_context *render_target, ID3D10Buffer **ps_cb)
{
D3D10_SUBRESOURCE_DATA buffer_data;
struct d2d_ps_cb cb_data = {0};
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index 925fcf48ce1..e00b9427977 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -117,9 +117,9 @@ struct d2d_ps_cb
struct d2d_brush_cb opacity_brush;
};
-struct d2d_d3d_render_target
+struct d2d_device_context
{
- ID2D1RenderTarget ID2D1RenderTarget_iface;
+ ID2D1DeviceContext ID2D1DeviceContext_iface;
ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface;
IDWriteTextRenderer IDWriteTextRenderer_iface;
LONG refcount;
@@ -210,7 +210,7 @@ struct d2d_bitmap_render_target
};
HRESULT d2d_bitmap_render_target_init(struct d2d_bitmap_render_target *render_target,
- const struct d2d_d3d_render_target *parent_target, const D2D1_SIZE_F *size,
+ const struct d2d_device_context *parent_target, const D2D1_SIZE_F *size,
const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *format,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options) DECLSPEC_HIDDEN;
@@ -282,7 +282,7 @@ HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap,
struct d2d_brush **brush) DECLSPEC_HIDDEN;
void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device, unsigned int brush_idx) DECLSPEC_HIDDEN;
HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush, BOOL outline,
- struct d2d_d3d_render_target *render_target, ID3D10Buffer **ps_cb) DECLSPEC_HIDDEN;
+ struct d2d_device_context *render_target, ID3D10Buffer **ps_cb) DECLSPEC_HIDDEN;
struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN;
struct d2d_stroke_style
@@ -335,7 +335,7 @@ struct d2d_bitmap
HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data,
UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
-HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device *device, REFIID iid, void *data,
+HRESULT d2d_bitmap_create_shared(ID2D1DeviceContext *context, ID3D10Device *device, REFIID iid, void *data,
const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source,
const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index cb7e8a540a5..bba4870dd4e 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -118,7 +118,7 @@ static void d2d_clip_stack_pop(struct d2d_clip_stack *stack)
--stack->count;
}
-static void d2d_rt_draw(struct d2d_d3d_render_target *render_target, enum d2d_shape_type shape_type,
+static void d2d_device_context_draw(struct d2d_device_context *render_target, enum d2d_shape_type shape_type,
ID3D10Buffer *ib, unsigned int index_count, ID3D10Buffer *vb, unsigned int vb_stride,
ID3D10Buffer *vs_cb, ID3D10Buffer *ps_cb, struct d2d_brush *brush, struct d2d_brush *opacity_brush)
{
@@ -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_ID2D1RenderTarget(ID2D1RenderTarget *iface)
+static inline struct d2d_device_context *impl_from_ID2D1DeviceContext(ID2D1DeviceContext *iface)
{
- return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, ID2D1RenderTarget_iface);
+ return CONTAINING_RECORD(iface, struct d2d_device_context, ID2D1DeviceContext_iface);
}
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_QueryInterface(ID2D1RenderTarget *iface, REFIID iid, void **out)
+static inline struct d2d_device_context *impl_from_ID2D1RenderTarget(ID2D1RenderTarget *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ return CONTAINING_RECORD(iface, struct d2d_device_context, ID2D1DeviceContext_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE d2d_device_context_QueryInterface(ID2D1DeviceContext *iface, REFIID iid, void **out)
+{
+ struct d2d_device_context *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_device_context_AddRef(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_Release(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_GetFactory(ID2D1DeviceContext *iface, ID2D1Factory **factory)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_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_device_context *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_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
struct d2d_bitmap *object;
HRESULT hr;
@@ -313,10 +319,10 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap
return hr;
}
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1RenderTarget *iface,
+static HRESULT STDMETHODCALLTYPE d2d_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
struct d2d_bitmap *object;
HRESULT hr;
@@ -329,11 +335,11 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSharedBitmap(ID2D1R
return hr;
}
-static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1RenderTarget *iface,
+static HRESULT STDMETHODCALLTYPE d2d_device_context_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_device_context *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_device_context_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_device_context *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_device_context_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_device_context *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_device_context_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_device_context *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_device_context_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_device_context *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_device_context_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_device_context *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_device_context_CreateLayer(ID2D1DeviceContext *iface,
const D2D1_SIZE_F *size, ID2D1Layer **layer)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_CreateMesh(ID2D1DeviceContext *iface, ID2D1Mesh **mesh)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_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_device_context *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_device_context_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_device_context *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_device_context_FillRectangle(ID2D1DeviceContext *iface,
const D2D1_RECT_F *rect, ID2D1Brush *brush)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_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_device_context *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_device_context_FillRoundedRectangle(ID2D1DeviceContext *iface,
const D2D1_ROUNDED_RECT *rect, ID2D1Brush *brush)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_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_device_context *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_device_context_FillEllipse(ID2D1DeviceContext *iface,
const D2D1_ELLIPSE *ellipse, ID2D1Brush *brush)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
ID2D1EllipseGeometry *geometry;
HRESULT hr;
@@ -620,11 +626,11 @@ 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);
}
-static void d2d_rt_draw_geometry(struct d2d_d3d_render_target *render_target,
+static void d2d_device_context_draw_geometry(struct d2d_device_context *render_target,
const struct d2d_geometry *geometry, struct d2d_brush *brush, float stroke_width)
{
ID3D10Buffer *ib, *vb, *vs_cb, *ps_cb;
@@ -713,7 +719,7 @@ static void d2d_rt_draw_geometry(struct d2d_d3d_render_target *render_target,
goto done;
}
- d2d_rt_draw(render_target, D2D_SHAPE_TYPE_OUTLINE, ib, 3 * geometry->outline.face_count, vb,
+ d2d_device_context_draw(render_target, D2D_SHAPE_TYPE_OUTLINE, ib, 3 * geometry->outline.face_count, vb,
sizeof(*geometry->outline.vertices), vs_cb, ps_cb, brush, NULL);
ID3D10Buffer_Release(vb);
@@ -743,7 +749,8 @@ static void d2d_rt_draw_geometry(struct d2d_d3d_render_target *render_target,
goto done;
}
- d2d_rt_draw(render_target, D2D_SHAPE_TYPE_BEZIER_OUTLINE, ib, 3 * geometry->outline.bezier_face_count, vb,
+ d2d_device_context_draw(render_target, D2D_SHAPE_TYPE_BEZIER_OUTLINE, ib,
+ 3 * geometry->outline.bezier_face_count, vb,
sizeof(*geometry->outline.beziers), vs_cb, ps_cb, brush, NULL);
ID3D10Buffer_Release(vb);
@@ -755,11 +762,11 @@ done:
ID3D10Buffer_Release(vs_cb);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1RenderTarget *iface,
+static void STDMETHODCALLTYPE d2d_device_context_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_device_context *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",
@@ -768,10 +775,10 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGeometry(ID2D1RenderTarg
if (stroke_style)
FIXME("Ignoring stroke style %p.\n", stroke_style);
- d2d_rt_draw_geometry(render_target, geometry_impl, brush_impl, stroke_width);
+ d2d_device_context_draw_geometry(render_target, geometry_impl, brush_impl, stroke_width);
}
-static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
+static void d2d_device_context_fill_geometry(struct d2d_device_context *render_target,
const struct d2d_geometry *geometry, struct d2d_brush *brush, struct d2d_brush *opacity_brush)
{
ID3D10Buffer *ib, *vb, *vs_cb, *ps_cb;
@@ -860,7 +867,7 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
goto done;
}
- d2d_rt_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, ib, 3 * geometry->fill.face_count, vb,
+ d2d_device_context_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, ib, 3 * geometry->fill.face_count, vb,
sizeof(*geometry->fill.vertices), vs_cb, ps_cb, brush, opacity_brush);
ID3D10Buffer_Release(vb);
@@ -878,7 +885,7 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
goto done;
}
- d2d_rt_draw(render_target, D2D_SHAPE_TYPE_BEZIER, NULL, geometry->fill.bezier_vertex_count, vb,
+ d2d_device_context_draw(render_target, D2D_SHAPE_TYPE_BEZIER, NULL, geometry->fill.bezier_vertex_count, vb,
sizeof(*geometry->fill.bezier_vertices), vs_cb, ps_cb, brush, opacity_brush);
ID3D10Buffer_Release(vb);
@@ -889,12 +896,12 @@ done:
ID3D10Buffer_Release(vs_cb);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarget *iface,
+static void STDMETHODCALLTYPE d2d_device_context_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_device_context *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);
@@ -910,16 +917,16 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillGeometry(ID2D1RenderTarg
return;
}
- d2d_rt_fill_geometry(render_target, geometry_impl, brush_impl, opacity_brush_impl);
+ d2d_device_context_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_device_context_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_device_context_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 +934,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_device_context_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 +986,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 = d2d_device_context_CreateBitmapBrush(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);
+ d2d_device_context_FillRectangle(iface, &d, (ID2D1Brush *)brush);
ID2D1BitmapBrush_Release(brush);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawText(ID2D1RenderTarget *iface,
+static void STDMETHODCALLTYPE d2d_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
IDWriteTextLayout *text_layout;
IDWriteFactory *dwrite_factory;
D2D1_POINT_2F origin;
@@ -1026,14 +1033,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_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
struct d2d_draw_text_layout_ctx ctx;
HRESULT hr;
@@ -1048,7 +1055,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawTextLayout(ID2D1RenderTa
FIXME("Failed to draw text layout, hr %#x.\n", hr);
}
-static D2D1_ANTIALIAS_MODE d2d_d3d_render_target_set_aa_mode_from_text_aa_mode(struct d2d_d3d_render_target *rt)
+static D2D1_ANTIALIAS_MODE d2d_device_context_set_aa_mode_from_text_aa_mode(struct d2d_device_context *rt)
{
D2D1_ANTIALIAS_MODE prev_antialias_mode = rt->drawing_state.antialiasMode;
rt->drawing_state.antialiasMode = rt->drawing_state.textAntialiasMode == D2D1_TEXT_ANTIALIAS_MODE_ALIASED ?
@@ -1056,7 +1063,7 @@ static D2D1_ANTIALIAS_MODE d2d_d3d_render_target_set_aa_mode_from_text_aa_mode(s
return prev_antialias_mode;
}
-static void d2d_rt_draw_glyph_run_outline(struct d2d_d3d_render_target *render_target,
+static void d2d_device_context_draw_glyph_run_outline(struct d2d_device_context *render_target,
D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush)
{
D2D1_MATRIX_3X2_F *transform, prev_transform;
@@ -1096,8 +1103,8 @@ static void d2d_rt_draw_glyph_run_outline(struct d2d_d3d_render_target *render_t
prev_transform = *transform;
transform->_31 += baseline_origin.x * transform->_11 + baseline_origin.y * transform->_21;
transform->_32 += baseline_origin.x * transform->_12 + baseline_origin.y * transform->_22;
- prev_antialias_mode = d2d_d3d_render_target_set_aa_mode_from_text_aa_mode(render_target);
- d2d_rt_fill_geometry(render_target, unsafe_impl_from_ID2D1Geometry((ID2D1Geometry *)geometry),
+ prev_antialias_mode = d2d_device_context_set_aa_mode_from_text_aa_mode(render_target);
+ d2d_device_context_fill_geometry(render_target, unsafe_impl_from_ID2D1Geometry((ID2D1Geometry *)geometry),
unsafe_impl_from_ID2D1Brush(brush), NULL);
render_target->drawing_state.antialiasMode = prev_antialias_mode;
*transform = prev_transform;
@@ -1105,7 +1112,7 @@ static void d2d_rt_draw_glyph_run_outline(struct d2d_d3d_render_target *render_t
ID2D1PathGeometry_Release(geometry);
}
-static void d2d_rt_draw_glyph_run_bitmap(struct d2d_d3d_render_target *render_target,
+static void d2d_device_context_draw_glyph_run_bitmap(struct d2d_device_context *render_target,
D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush,
DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode,
DWRITE_TEXT_ANTIALIAS_MODE antialias_mode)
@@ -1196,7 +1203,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_device_context_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 +1220,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_device_context_CreateBitmapBrush(&render_target->ID2D1DeviceContext_iface,
opacity_bitmap, NULL, &brush_desc, &opacity_brush)))
{
ERR("Failed to create opacity bitmap brush, hr %#x.\n", hr);
@@ -1228,7 +1235,7 @@ static void d2d_rt_draw_glyph_run_bitmap(struct d2d_d3d_render_target *render_ta
m = *transform;
*transform = identity;
- d2d_rt_fill_geometry(render_target, unsafe_impl_from_ID2D1Geometry((ID2D1Geometry *)geometry),
+ d2d_device_context_fill_geometry(render_target, unsafe_impl_from_ID2D1Geometry((ID2D1Geometry *)geometry),
unsafe_impl_from_ID2D1Brush(brush), unsafe_impl_from_ID2D1Brush((ID2D1Brush *)opacity_brush));
*transform = m;
@@ -1243,11 +1250,11 @@ done:
IDWriteGlyphRunAnalysis_Release(analysis);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGlyphRun(ID2D1RenderTarget *iface,
+static void STDMETHODCALLTYPE d2d_device_context_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_device_context *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;
@@ -1319,74 +1326,74 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawGlyphRun(ID2D1RenderTarg
}
if (rendering_mode == DWRITE_RENDERING_MODE_OUTLINE)
- d2d_rt_draw_glyph_run_outline(render_target, baseline_origin, glyph_run, brush);
+ d2d_device_context_draw_glyph_run_outline(render_target, baseline_origin, glyph_run, brush);
else
- d2d_rt_draw_glyph_run_bitmap(render_target, baseline_origin, glyph_run, brush,
+ d2d_device_context_draw_glyph_run_bitmap(render_target, baseline_origin, glyph_run, brush,
rendering_mode, measuring_mode, antialias_mode);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_SetTransform(ID2D1RenderTarget *iface,
+static void STDMETHODCALLTYPE d2d_device_context_SetTransform(ID2D1DeviceContext *iface,
const D2D1_MATRIX_3X2_F *transform)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_GetTransform(ID2D1DeviceContext *iface,
D2D1_MATRIX_3X2_F *transform)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_SetAntialiasMode(ID2D1DeviceContext *iface,
D2D1_ANTIALIAS_MODE antialias_mode)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_GetAntialiasMode(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_SetTextAntialiasMode(ID2D1DeviceContext *iface,
D2D1_TEXT_ANTIALIAS_MODE antialias_mode)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_GetTextAntialiasMode(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_SetTextRenderingParams(ID2D1DeviceContext *iface,
IDWriteRenderingParams *text_rendering_params)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params);
@@ -1397,10 +1404,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_device_context_GetTextRenderingParams(ID2D1DeviceContext *iface,
IDWriteRenderingParams **text_rendering_params)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, text_rendering_params %p.\n", iface, text_rendering_params);
@@ -1408,9 +1415,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_device_context_SetTags(ID2D1DeviceContext *iface, D2D1_TAG tag1, D2D1_TAG tag2)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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 +1425,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_device_context_GetTags(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
@@ -1428,29 +1435,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_device_context_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_device_context_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_device_context_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_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, state_block %p.\n", iface, state_block);
@@ -1462,11 +1469,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_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, state_block %p.\n", iface, state_block);
@@ -1478,10 +1485,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_device_context_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_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
D2D1_RECT_F transformed_rect;
float x_scale, y_scale;
D2D1_POINT_2F point;
@@ -1510,18 +1517,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_device_context_PopAxisAlignedClip(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_Clear(ID2D1DeviceContext *iface, const D2D1_COLOR_F *colour)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
D3D10_SUBRESOURCE_DATA buffer_data;
struct d2d_ps_cb ps_cb_data = {0};
D3D10_BUFFER_DESC buffer_desc;
@@ -1589,26 +1596,26 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_Clear(ID2D1RenderTarget *ifa
return;
}
- d2d_rt_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, render_target->ib, 6,
+ d2d_device_context_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, render_target->ib, 6,
render_target->vb, render_target->vb_stride, vs_cb, ps_cb, NULL, NULL);
ID3D10Buffer_Release(ps_cb);
ID3D10Buffer_Release(vs_cb);
}
-static void STDMETHODCALLTYPE d2d_d3d_render_target_BeginDraw(ID2D1RenderTarget *iface)
+static void STDMETHODCALLTYPE d2d_device_context_BeginDraw(ID2D1DeviceContext *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *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_device_context_EndDraw(ID2D1DeviceContext *iface,
D2D1_TAG *tag1, D2D1_TAG *tag2)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, tag1 %p, tag2 %p.\n", iface, tag1, tag2);
@@ -1620,10 +1627,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_device_context_GetPixelFormat(ID2D1DeviceContext *iface,
D2D1_PIXEL_FORMAT *format)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, format %p.\n", iface, format);
@@ -1631,9 +1638,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_device_context_SetDpi(ID2D1DeviceContext *iface, float dpi_x, float dpi_y)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, dpi_x %.8e, dpi_y %.8e.\n", iface, dpi_x, dpi_y);
@@ -1649,9 +1656,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_device_context_GetDpi(ID2D1DeviceContext *iface, float *dpi_x, float *dpi_y)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, dpi_x %p, dpi_y %p.\n", iface, dpi_x, dpi_y);
@@ -1659,9 +1666,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_device_context_GetSize(ID2D1DeviceContext *iface, D2D1_SIZE_F *size)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, size %p.\n", iface, size);
@@ -1670,10 +1677,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_device_context_GetPixelSize(ID2D1DeviceContext *iface,
D2D1_SIZE_U *pixel_size)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1DeviceContext(iface);
TRACE("iface %p, pixel_size %p.\n", iface, pixel_size);
@@ -1681,14 +1688,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_device_context_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_device_context_IsSupported(ID2D1DeviceContext *iface,
const D2D1_RENDER_TARGET_PROPERTIES *desc)
{
FIXME("iface %p, desc %p stub!\n", iface, desc);
@@ -1696,70 +1703,379 @@ static BOOL STDMETHODCALLTYPE d2d_d3d_render_target_IsSupported(ID2D1RenderTarge
return FALSE;
}
-static const struct ID2D1RenderTargetVtbl d2d_d3d_render_target_vtbl =
-{
- d2d_d3d_render_target_QueryInterface,
- d2d_d3d_render_target_AddRef,
- d2d_d3d_render_target_Release,
- d2d_d3d_render_target_GetFactory,
- d2d_d3d_render_target_CreateBitmap,
- d2d_d3d_render_target_CreateBitmapFromWicBitmap,
- d2d_d3d_render_target_CreateSharedBitmap,
- d2d_d3d_render_target_CreateBitmapBrush,
- d2d_d3d_render_target_CreateSolidColorBrush,
- d2d_d3d_render_target_CreateGradientStopCollection,
- d2d_d3d_render_target_CreateLinearGradientBrush,
- d2d_d3d_render_target_CreateRadialGradientBrush,
- d2d_d3d_render_target_CreateCompatibleRenderTarget,
- d2d_d3d_render_target_CreateLayer,
- d2d_d3d_render_target_CreateMesh,
- d2d_d3d_render_target_DrawLine,
- d2d_d3d_render_target_DrawRectangle,
- d2d_d3d_render_target_FillRectangle,
- d2d_d3d_render_target_DrawRoundedRectangle,
- d2d_d3d_render_target_FillRoundedRectangle,
- d2d_d3d_render_target_DrawEllipse,
- d2d_d3d_render_target_FillEllipse,
- d2d_d3d_render_target_DrawGeometry,
- d2d_d3d_render_target_FillGeometry,
- d2d_d3d_render_target_FillMesh,
- d2d_d3d_render_target_FillOpacityMask,
- d2d_d3d_render_target_DrawBitmap,
- d2d_d3d_render_target_DrawText,
- d2d_d3d_render_target_DrawTextLayout,
- d2d_d3d_render_target_DrawGlyphRun,
- d2d_d3d_render_target_SetTransform,
- d2d_d3d_render_target_GetTransform,
- d2d_d3d_render_target_SetAntialiasMode,
- d2d_d3d_render_target_GetAntialiasMode,
- d2d_d3d_render_target_SetTextAntialiasMode,
- d2d_d3d_render_target_GetTextAntialiasMode,
- d2d_d3d_render_target_SetTextRenderingParams,
- d2d_d3d_render_target_GetTextRenderingParams,
- d2d_d3d_render_target_SetTags,
- d2d_d3d_render_target_GetTags,
- d2d_d3d_render_target_PushLayer,
- d2d_d3d_render_target_PopLayer,
- d2d_d3d_render_target_Flush,
- d2d_d3d_render_target_SaveDrawingState,
- d2d_d3d_render_target_RestoreDrawingState,
- d2d_d3d_render_target_PushAxisAlignedClip,
- d2d_d3d_render_target_PopAxisAlignedClip,
- d2d_d3d_render_target_Clear,
- d2d_d3d_render_target_BeginDraw,
- d2d_d3d_render_target_EndDraw,
- d2d_d3d_render_target_GetPixelFormat,
- d2d_d3d_render_target_SetDpi,
- d2d_d3d_render_target_GetDpi,
- d2d_d3d_render_target_GetSize,
- d2d_d3d_render_target_GetPixelSize,
- d2d_d3d_render_target_GetMaximumBitmapSize,
- d2d_d3d_render_target_IsSupported,
+static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_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_ID2D1DeviceContext_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 %#x, 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_ID2D1DeviceContext_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 %#x, postinterpolation_space %#x, "
+ "buffer_precision %#x, extend_mode %#x, color_interpolation_mode %#x, 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_ID2D1DeviceContext_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 %#x 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 %#x 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 %#x, 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 %#x 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 %#x 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_ID2D1DeviceContext_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 %#x 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 %s, interpolation_mode %#x, composite_mode %#x stub!\n",
+ iface, image, target_offset, debug_d2d_rect_f(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_ID2D1DeviceContext_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 %s, opacity %.8e, interpolation_mode %#x, "
+ "src_rect %s, perspective_transform %p stub!\n",
+ iface, bitmap, debug_d2d_rect_f(dst_rect), opacity, interpolation_mode,
+ debug_d2d_rect_f(src_rect), perspective_transform);
+}
+
+static void STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_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_ID2D1DeviceContext_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_device_context_QueryInterface,
+ d2d_device_context_AddRef,
+ d2d_device_context_Release,
+ d2d_device_context_GetFactory,
+ d2d_device_context_CreateBitmap,
+ d2d_device_context_CreateBitmapFromWicBitmap,
+ d2d_device_context_CreateSharedBitmap,
+ d2d_device_context_CreateBitmapBrush,
+ d2d_device_context_CreateSolidColorBrush,
+ d2d_device_context_CreateGradientStopCollection,
+ d2d_device_context_CreateLinearGradientBrush,
+ d2d_device_context_CreateRadialGradientBrush,
+ d2d_device_context_CreateCompatibleRenderTarget,
+ d2d_device_context_CreateLayer,
+ d2d_device_context_CreateMesh,
+ d2d_device_context_DrawLine,
+ d2d_device_context_DrawRectangle,
+ d2d_device_context_FillRectangle,
+ d2d_device_context_DrawRoundedRectangle,
+ d2d_device_context_FillRoundedRectangle,
+ d2d_device_context_DrawEllipse,
+ d2d_device_context_FillEllipse,
+ d2d_device_context_DrawGeometry,
+ d2d_device_context_FillGeometry,
+ d2d_device_context_FillMesh,
+ d2d_device_context_FillOpacityMask,
+ d2d_device_context_DrawBitmap,
+ d2d_device_context_DrawText,
+ d2d_device_context_DrawTextLayout,
+ d2d_device_context_DrawGlyphRun,
+ d2d_device_context_SetTransform,
+ d2d_device_context_GetTransform,
+ d2d_device_context_SetAntialiasMode,
+ d2d_device_context_GetAntialiasMode,
+ d2d_device_context_SetTextAntialiasMode,
+ d2d_device_context_GetTextAntialiasMode,
+ d2d_device_context_SetTextRenderingParams,
+ d2d_device_context_GetTextRenderingParams,
+ d2d_device_context_SetTags,
+ d2d_device_context_GetTags,
+ d2d_device_context_PushLayer,
+ d2d_device_context_PopLayer,
+ d2d_device_context_Flush,
+ d2d_device_context_SaveDrawingState,
+ d2d_device_context_RestoreDrawingState,
+ d2d_device_context_PushAxisAlignedClip,
+ d2d_device_context_PopAxisAlignedClip,
+ d2d_device_context_Clear,
+ d2d_device_context_BeginDraw,
+ d2d_device_context_EndDraw,
+ d2d_device_context_GetPixelFormat,
+ d2d_device_context_SetDpi,
+ d2d_device_context_GetDpi,
+ d2d_device_context_GetSize,
+ d2d_device_context_GetPixelSize,
+ d2d_device_context_GetMaximumBitmapSize,
+ d2d_device_context_IsSupported,
+ d2d_device_context_ID2D1DeviceContext_CreateBitmap,
+ d2d_device_context_ID2D1DeviceContext_CreateBitmapFromWicBitmap,
+ d2d_device_context_CreateColorContext,
+ d2d_device_context_CreateColorContextFromFilename,
+ d2d_device_context_CreateColorContextFromWicColorContext,
+ d2d_device_context_CreateBitmapFromDxgiSurface,
+ d2d_device_context_CreateEffect,
+ d2d_device_context_ID2D1DeviceContext_CreateGradientStopCollection,
+ d2d_device_context_CreateImageBrush,
+ d2d_device_context_ID2D1DeviceContext_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_ID2D1DeviceContext_DrawGlyphRun,
+ d2d_device_context_DrawImage,
+ d2d_device_context_DrawGdiMetafile,
+ d2d_device_context_ID2D1DeviceContext_DrawBitmap,
+ d2d_device_context_ID2D1DeviceContext_PushLayer,
+ d2d_device_context_InvalidateEffectInputRectangle,
+ d2d_device_context_GetEffectInvalidRectangleCount,
+ d2d_device_context_GetEffectInvalidRectangles,
+ d2d_device_context_GetEffectRequiredInputRectangles,
+ d2d_device_context_ID2D1DeviceContext_FillOpacityMask,
};
-static inline struct d2d_d3d_render_target *impl_from_IDWriteTextRenderer(IDWriteTextRenderer *iface)
+static inline struct d2d_device_context *impl_from_IDWriteTextRenderer(IDWriteTextRenderer *iface)
{
- return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, IDWriteTextRenderer_iface);
+ return CONTAINING_RECORD(iface, struct d2d_device_context, IDWriteTextRenderer_iface);
}
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_QueryInterface(IDWriteTextRenderer *iface, REFIID iid, void **out)
@@ -1783,20 +2099,20 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_QueryInterface(IDWriteTextRen
static ULONG STDMETHODCALLTYPE d2d_text_renderer_AddRef(IDWriteTextRenderer *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
TRACE("iface %p.\n", iface);
- return d2d_d3d_render_target_AddRef(&render_target->ID2D1RenderTarget_iface);
+ return d2d_device_context_AddRef(&render_target->ID2D1DeviceContext_iface);
}
static ULONG STDMETHODCALLTYPE d2d_text_renderer_Release(IDWriteTextRenderer *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
TRACE("iface %p.\n", iface);
- return d2d_d3d_render_target_Release(&render_target->ID2D1RenderTarget_iface);
+ return d2d_device_context_Release(&render_target->ID2D1DeviceContext_iface);
}
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface,
@@ -1814,18 +2130,18 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_IsPixelSnappingDisabled(IDWri
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_GetCurrentTransform(IDWriteTextRenderer *iface,
void *ctx, DWRITE_MATRIX *transform)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
TRACE("iface %p, ctx %p, transform %p.\n", iface, ctx, transform);
- ID2D1RenderTarget_GetTransform(&render_target->ID2D1RenderTarget_iface, (D2D1_MATRIX_3X2_F *)transform);
+ d2d_device_context_GetTransform(&render_target->ID2D1DeviceContext_iface, (D2D1_MATRIX_3X2_F *)transform);
return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_GetPixelsPerDip(IDWriteTextRenderer *iface, void *ctx, float *ppd)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
TRACE("iface %p, ctx %p, ppd %p.\n", iface, ctx, ppd);
@@ -1838,7 +2154,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende
float baseline_origin_x, float baseline_origin_y, DWRITE_MEASURING_MODE measuring_mode,
const DWRITE_GLYPH_RUN *glyph_run, const DWRITE_GLYPH_RUN_DESCRIPTION *desc, IUnknown *effect)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
D2D1_POINT_2F baseline_origin = {baseline_origin_x, baseline_origin_y};
struct d2d_draw_text_layout_ctx *context = ctx;
BOOL color_font = FALSE;
@@ -1920,7 +2236,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 = d2d_device_context_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 +2246,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,
+ d2d_device_context_DrawGlyphRun(&render_target->ID2D1DeviceContext_iface,
origin, &color_run->glyphRun, color_brush, measuring_mode);
if (color_brush != brush)
@@ -1940,7 +2256,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende
IDWriteColorGlyphRunEnumerator_Release(layers);
}
else
- ID2D1RenderTarget_DrawGlyphRun(&render_target->ID2D1RenderTarget_iface,
+ d2d_device_context_DrawGlyphRun(&render_target->ID2D1DeviceContext_iface,
baseline_origin, glyph_run, brush, measuring_mode);
ID2D1Brush_Release(brush);
@@ -1951,7 +2267,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawGlyphRun(IDWriteTextRende
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRenderer *iface, void *ctx,
float baseline_origin_x, float baseline_origin_y, const DWRITE_UNDERLINE *underline, IUnknown *effect)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
const D2D1_MATRIX_3X2_F *m = &render_target->drawing_state.transform;
struct d2d_draw_text_layout_ctx *context = ctx;
D2D1_ANTIALIAS_MODE prev_antialias_mode;
@@ -1972,8 +2288,8 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRend
start.y = baseline_origin_y + underline->offset + thickness / 2.0f;
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);
+ prev_antialias_mode = d2d_device_context_set_aa_mode_from_text_aa_mode(render_target);
+ d2d_device_context_DrawLine(&render_target->ID2D1DeviceContext_iface, start, end, brush, thickness, NULL);
render_target->drawing_state.antialiasMode = prev_antialias_mode;
ID2D1Brush_Release(brush);
@@ -1984,7 +2300,7 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawUnderline(IDWriteTextRend
static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawStrikethrough(IDWriteTextRenderer *iface, void *ctx,
float baseline_origin_x, float baseline_origin_y, const DWRITE_STRIKETHROUGH *strikethrough, IUnknown *effect)
{
- struct d2d_d3d_render_target *render_target = impl_from_IDWriteTextRenderer(iface);
+ struct d2d_device_context *render_target = impl_from_IDWriteTextRenderer(iface);
const D2D1_MATRIX_3X2_F *m = &render_target->drawing_state.transform;
struct d2d_draw_text_layout_ctx *context = ctx;
D2D1_ANTIALIAS_MODE prev_antialias_mode;
@@ -2005,8 +2321,8 @@ static HRESULT STDMETHODCALLTYPE d2d_text_renderer_DrawStrikethrough(IDWriteText
start.y = baseline_origin_y + strikethrough->offset + thickness / 2.0f;
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);
+ prev_antialias_mode = d2d_device_context_set_aa_mode_from_text_aa_mode(render_target);
+ d2d_device_context_DrawLine(&render_target->ID2D1DeviceContext_iface, start, end, brush, thickness, NULL);
render_target->drawing_state.antialiasMode = prev_antialias_mode;
ID2D1Brush_Release(brush);
@@ -2053,15 +2369,15 @@ static const struct IDWriteTextRendererVtbl d2d_text_renderer_vtbl =
d2d_text_renderer_DrawInlineObject,
};
-static inline struct d2d_d3d_render_target *impl_from_ID2D1GdiInteropRenderTarget(ID2D1GdiInteropRenderTarget *iface)
+static inline struct d2d_device_context *impl_from_ID2D1GdiInteropRenderTarget(ID2D1GdiInteropRenderTarget *iface)
{
- return CONTAINING_RECORD(iface, struct d2d_d3d_render_target, ID2D1GdiInteropRenderTarget_iface);
+ return CONTAINING_RECORD(iface, struct d2d_device_context, ID2D1GdiInteropRenderTarget_iface);
}
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_QueryInterface(ID2D1GdiInteropRenderTarget *iface,
REFIID iid, void **out)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
@@ -2070,7 +2386,7 @@ static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_QueryInterface(ID
static ULONG STDMETHODCALLTYPE d2d_gdi_interop_render_target_AddRef(ID2D1GdiInteropRenderTarget *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
TRACE("iface %p.\n", iface);
@@ -2079,14 +2395,14 @@ static ULONG STDMETHODCALLTYPE d2d_gdi_interop_render_target_AddRef(ID2D1GdiInte
static ULONG STDMETHODCALLTYPE d2d_gdi_interop_render_target_Release(ID2D1GdiInteropRenderTarget *iface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
TRACE("iface %p.\n", iface);
return IUnknown_Release(render_target->outer_unknown);
}
-static HRESULT d2d_d3d_render_target_get_surface(struct d2d_d3d_render_target *render_target, IDXGISurface1 **surface)
+static HRESULT d2d_device_context_get_surface(struct d2d_device_context *render_target, IDXGISurface1 **surface)
{
ID3D10Resource *resource;
HRESULT hr;
@@ -2107,13 +2423,13 @@ static HRESULT d2d_d3d_render_target_get_surface(struct d2d_d3d_render_target *r
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_GetDC(ID2D1GdiInteropRenderTarget *iface,
D2D1_DC_INITIALIZE_MODE mode, HDC *dc)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
IDXGISurface1 *surface;
HRESULT hr;
TRACE("iface %p, mode %d, dc %p.\n", iface, mode, dc);
- if (FAILED(hr = d2d_d3d_render_target_get_surface(render_target, &surface)))
+ if (FAILED(hr = d2d_device_context_get_surface(render_target, &surface)))
return hr;
hr = IDXGISurface1_GetDC(surface, mode != D2D1_DC_INITIALIZE_MODE_COPY, dc);
@@ -2125,14 +2441,14 @@ static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_GetDC(ID2D1GdiInt
static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_ReleaseDC(ID2D1GdiInteropRenderTarget *iface,
const RECT *update)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
IDXGISurface1 *surface;
RECT update_rect;
HRESULT hr;
TRACE("iface %p, update rect %s.\n", iface, wine_dbgstr_rect(update));
- if (FAILED(hr = d2d_d3d_render_target_get_surface(render_target, &surface)))
+ if (FAILED(hr = d2d_device_context_get_surface(render_target, &surface)))
return hr;
if (update)
@@ -2152,7 +2468,7 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
d2d_gdi_interop_render_target_ReleaseDC,
};
-static HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
+static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, ID2D1Factory *factory,
IDXGISurface *surface, IUnknown *outer_unknown, const D2D1_RENDER_TARGET_PROPERTIES *desc)
{
D3D10_SUBRESOURCE_DATA buffer_data;
@@ -3032,7 +3348,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 +3356,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)))
{
@@ -3241,13 +3557,13 @@ err:
HRESULT d2d_d3d_create_render_target(ID2D1Factory *factory, IDXGISurface *surface, IUnknown *outer_unknown,
const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target)
{
- struct d2d_d3d_render_target *object;
+ struct d2d_device_context *object;
HRESULT hr;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- if (FAILED(hr = d2d_d3d_render_target_init(object, factory, surface, outer_unknown, desc)))
+ if (FAILED(hr = d2d_device_context_init(object, factory, surface, outer_unknown, desc)))
{
WARN("Failed to initialize render target, hr %#x.\n", hr);
heap_free(object);
@@ -3255,14 +3571,14 @@ 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;
}
HRESULT d2d_d3d_render_target_create_rtv(ID2D1RenderTarget *iface, IDXGISurface1 *surface)
{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
+ struct d2d_device_context *render_target = impl_from_ID2D1RenderTarget(iface);
DXGI_SURFACE_DESC surface_desc;
ID3D10RenderTargetView *view;
ID3D10Resource *resource;
--
2.11.0