From: Lucian Poston lucian.poston@gmail.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Same patch, resending.
include/d2d1_1.idl | 284 ++++++++++++++++++++++++++++++++++++++++++++ include/dcommon.idl | 20 ++++ 2 files changed, 304 insertions(+)
diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl index 4b6224afe3..4d30f6fd34 100644 --- a/include/d2d1_1.idl +++ b/include/d2d1_1.idl @@ -27,7 +27,18 @@ interface ID2D1Properties; interface IPrintDocumentPackageTarget; interface ID2D1PrintControl; interface IWICImagingFactory; +interface IWICColorContext; interface ID2D1ColorContext; +interface ID2D1Effect; +interface ID2D1GradientStopCollection1; +interface ID2D1ImageBrush; +interface ID2D1BitmapBrush1; +interface ID2D1CommandList; + +cpp_quote("#ifndef __dwrite_h__") +/* already defined in dwrite.h but needed for WIDL */ +typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION; +cpp_quote("#endif /* __dwrite_h__ */")
typedef enum D2D1_DEVICE_CONTEXT_OPTIONS { @@ -96,7 +107,63 @@ typedef enum D2D1_MAP_OPTIONS D2D1_MAP_OPTIONS_FORCE_DWORD = 0xffffffff, } D2D1_MAP_OPTIONS;
+typedef enum D2D1_BUFFER_PRECISION +{ + D2D1_BUFFER_PRECISION_UNKNOWN = 0, + D2D1_BUFFER_PRECISION_8BPC_UNORM = 1, + D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2, + D2D1_BUFFER_PRECISION_16BPC_UNORM = 3, + D2D1_BUFFER_PRECISION_16BPC_FLOAT = 4, + D2D1_BUFFER_PRECISION_32BPC_FLOAT = 5, + D2D1_BUFFER_PRECISION_FORCE_DWORD = 0xffffffff, +} D2D1_BUFFER_PRECISION; + +typedef enum D2D1_COLOR_INTERPOLATION_MODE +{ + D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT = 0, + D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED = 1, + D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +} D2D1_COLOR_INTERPOLATION_MODE; + +typedef enum D2D1_INTERPOLATION_MODE +{ + D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR, + D2D1_INTERPOLATION_MODE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR, + D2D1_INTERPOLATION_MODE_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC, + D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR, + D2D1_INTERPOLATION_MODE_ANISOTROPIC = D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC, + D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC, + D2D1_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +} D2D1_INTERPOLATION_MODE; + +typedef enum D2D1_COMPOSITE_MODE +{ + D2D1_COMPOSITE_MODE_SOURCE_OVER = 0, + D2D1_COMPOSITE_MODE_DESTINATION_OVER = 1, + D2D1_COMPOSITE_MODE_SOURCE_IN = 2, + D2D1_COMPOSITE_MODE_DESTINATION_IN = 3, + D2D1_COMPOSITE_MODE_SOURCE_OUT = 4, + D2D1_COMPOSITE_MODE_DESTINATION_OUT = 5, + D2D1_COMPOSITE_MODE_SOURCE_ATOP = 6, + D2D1_COMPOSITE_MODE_DESTINATION_ATOP = 7, + D2D1_COMPOSITE_MODE_XOR = 8, + D2D1_COMPOSITE_MODE_PLUS = 9, + D2D1_COMPOSITE_MODE_SOURCE_COPY = 10, + D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY = 11, + D2D1_COMPOSITE_MODE_MASK_INVERT = 12, + D2D1_COMPOSITE_MODE_FORCE_DWORD = 0xffffffff, +} D2D1_COMPOSITE_MODE; + +typedef enum D2D1_LAYER_OPTIONS1 +{ + D2D1_LAYER_OPTIONS1_NONE = 0, + D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1, + D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2, + D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff, +} D2D1_LAYER_OPTIONS1; + typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING; +typedef D2D_MATRIX_4X4_F D2D1_MATRIX_4X4_F;
typedef struct D2D1_STROKE_STYLE_PROPERTIES1 { @@ -134,6 +201,54 @@ typedef struct D2D1_MAPPED_RECT BYTE *bits; } D2D1_MAPPED_RECT;
+typedef struct D2D1_BITMAP_PROPERTIES1 +{ + D2D1_PIXEL_FORMAT pixelFormat; + float dpiX; + float dpiY; + D2D1_BITMAP_OPTIONS bitmapOptions; + ID2D1ColorContext *colorContext; +} D2D1_BITMAP_PROPERTIES1; + +typedef struct D2D1_IMAGE_BRUSH_PROPERTIES +{ + D2D1_RECT_F sourceRectangle; + D2D1_EXTEND_MODE extendModeX; + D2D1_EXTEND_MODE extendModeY; + D2D1_INTERPOLATION_MODE interpolationMode; +} D2D1_IMAGE_BRUSH_PROPERTIES; + +typedef struct D2D1_BITMAP_BRUSH_PROPERTIES1 +{ + D2D1_EXTEND_MODE extendModeX; + D2D1_EXTEND_MODE extendModeY; + D2D1_INTERPOLATION_MODE interpolationMode; +} D2D1_BITMAP_BRUSH_PROPERTIES1; + +typedef struct D2D1_RENDERING_CONTROLS +{ + D2D1_BUFFER_PRECISION bufferPrecision; + D2D1_SIZE_U tileSize; +} D2D1_RENDERING_CONTROLS; + +typedef struct D2D1_LAYER_PARAMETERS1 +{ + D2D1_RECT_F contentBounds; + ID2D1Geometry *geometricMask; + D2D1_ANTIALIAS_MODE maskAntialiasMode; + D2D1_MATRIX_3X2_F maskTransform; + float opacity; + ID2D1Brush *opacityBrush; + D2D1_LAYER_OPTIONS1 layerOptions; +} D2D1_LAYER_PARAMETERS1; + +typedef struct D2D1_EFFECT_INPUT_DESCRIPTION +{ + ID2D1Effect *effect; + UINT32 inputIndex; + D2D1_RECT_F inputRectangle; +} D2D1_EFFECT_INPUT_DESCRIPTION; + typedef HRESULT (__stdcall *PD2D1_EFFECT_FACTORY)(IUnknown **effect);
[ @@ -183,6 +298,175 @@ interface ID2D1Device : ID2D1Resource ); }
+[ + object, + uuid(e8f7fe7a-191c-466d-ad95-975678bda998), + local, +] +interface ID2D1DeviceContext : ID2D1RenderTarget +{ + HRESULT CreateBitmap( + [in] D2D1_SIZE_U size, + [in] const void *src_data, + [in] UINT32 pitch, + [in] const D2D1_BITMAP_PROPERTIES1 *desc, + [out] ID2D1Bitmap1 **bitmap + ); + HRESULT CreateBitmapFromWicBitmap( + [in] IWICBitmapSource *bitmap_source, + [in] const D2D1_BITMAP_PROPERTIES1 *desc, + [out] ID2D1Bitmap1 **bitmap + ); + HRESULT CreateColorContext( + [in] D2D1_COLOR_SPACE space, + [in] const BYTE *profile, + [in] UINT32 profile_size, + [out] ID2D1ColorContext **color_context + ); + HRESULT CreateColorContextFromFilename( + [in] const WCHAR *filename, + [out] ID2D1ColorContext **color_context + ); + HRESULT CreateColorContextFromWicColorContext( + [in] IWICColorContext *wic_color_context, + [out] ID2D1ColorContext **color_context + ); + HRESULT CreateBitmapFromDxgiSurface( + [in] IDXGISurface *surface, + [in] const D2D1_BITMAP_PROPERTIES1 *desc, + [out] ID2D1Bitmap1 **bitmap + ); + HRESULT CreateEffect( + [in] REFCLSID effect_id, + [out] ID2D1Effect **effect + ); + HRESULT CreateGradientStopCollection( + [in] const D2D1_GRADIENT_STOP *stops, + [in] UINT32 stop_count, + [in] D2D1_COLOR_SPACE preinterpolation_space, + [in] D2D1_COLOR_SPACE postinterpolation_space, + [in] D2D1_BUFFER_PRECISION buffer_precision, + [in] D2D1_EXTEND_MODE extend_mode, + [in] D2D1_COLOR_INTERPOLATION_MODE color_interpolation_mode, + [out] ID2D1GradientStopCollection1 **gradient + ); + HRESULT CreateImageBrush( + [in] ID2D1Image *image, + [in] const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, + [in] const D2D1_BRUSH_PROPERTIES *brush_desc, + [out] ID2D1ImageBrush **brush + ); + HRESULT CreateBitmapBrush( + [in] ID2D1Bitmap *bitmap, + [in] const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, + [in] const D2D1_BRUSH_PROPERTIES *brush_desc, + [out] ID2D1BitmapBrush1 **bitmap_brush + ); + HRESULT CreateCommandList( + [out] ID2D1CommandList **command_list + ); + BOOL IsDxgiFormatSupported( + [in] DXGI_FORMAT format + ); + BOOL IsBufferPrecisionSupported( + [in] D2D1_BUFFER_PRECISION buffer_precision + ); + void GetImageLocalBounds( + [in] ID2D1Image *image, + [out] D2D1_RECT_F *local_bounds + ); + HRESULT GetImageWorldBounds( + [in] ID2D1Image *image, + [out] D2D1_RECT_F *world_bounds + ); + HRESULT GetGlyphRunWorldBounds( + [in] D2D1_POINT_2F baseline_origin, + [in] const DWRITE_GLYPH_RUN *glyph_run, + [in] DWRITE_MEASURING_MODE measuring_mode, + [out] D2D1_RECT_F *bounds + ); + void GetDevice( + [out] ID2D1Device **device + ); + void SetTarget( + [in] ID2D1Image *target + ); + void GetTarget( + [out] ID2D1Image **target + ); + void SetRenderingControls( + [in] const D2D1_RENDERING_CONTROLS *rendering_controls + ); + void GetRenderingControls( + [out] D2D1_RENDERING_CONTROLS *rendering_controls + ); + void SetPrimitiveBlend( + [in] D2D1_PRIMITIVE_BLEND primitive_blend + ); + D2D1_PRIMITIVE_BLEND GetPrimitiveBlend(); + void SetUnitMode( + [in] D2D1_UNIT_MODE unit_mode + ); + D2D1_UNIT_MODE GetUnitMode(); + void DrawGlyphRun( + [in] D2D1_POINT_2F baseline_origin, + [in] const DWRITE_GLYPH_RUN *glyph_run, + [in] const DWRITE_GLYPH_RUN_DESCRIPTION *glyph_run_desc, + [in] ID2D1Brush *brush, + [in] DWRITE_MEASURING_MODE measuring_mode + ); + void DrawImage( + [in] ID2D1Image *image, + [in] const D2D1_POINT_2F *target_offset, + [in] const D2D1_RECT_F *image_rect, + [in] D2D1_INTERPOLATION_MODE interpolation_mode, + [in] D2D1_COMPOSITE_MODE composite_mode + ); + void DrawGdiMetafile( + [in] ID2D1GdiMetafile *metafile, + [in] const D2D1_POINT_2F *target_offset + ); + void DrawBitmap( + [in] ID2D1Bitmap *bitmap, + [in] const D2D1_RECT_F *dst_rect, + [in] float opacity, + [in] D2D1_INTERPOLATION_MODE interpolation_mode, + [in] const D2D1_RECT_F *src_rect, + [in] const D2D1_MATRIX_4X4_F *perspective_transform + ); + void PushLayer( + [in] const D2D1_LAYER_PARAMETERS1 *layer_parameters, + [in] ID2D1Layer *layer + ); + HRESULT InvalidateEffectInputRectangle( + [in] ID2D1Effect *effect, + [in] UINT32 input, + [in] const D2D1_RECT_F *input_rect + ); + HRESULT GetEffectInvalidRectangleCount( + [in] ID2D1Effect *effect, + [out] UINT32 *rect_count + ); + HRESULT GetEffectInvalidRectangles( + [in] ID2D1Effect *effect, + [out] D2D1_RECT_F *rectangles, + [in] UINT32 rect_count + ); + HRESULT GetEffectRequiredInputRectangles( + [in] ID2D1Effect *effect, + [in] const D2D1_RECT_F *image_rect, + [in] const D2D1_EFFECT_INPUT_DESCRIPTION *desc, + [out] D2D1_RECT_F *input_rect, + [in] UINT32 input_count + ); + void FillOpacityMask( + [in] ID2D1Bitmap *mask, + [in] ID2D1Brush *brush, + [in] const D2D1_RECT_F *dst_rect, + [in] const D2D1_RECT_F *src_rect + ); +} + [ object, uuid(bb12d362-daee-4b9a-aa1d-14ba401cfa1f), diff --git a/include/dcommon.idl b/include/dcommon.idl index db5055d202..e651a75d0e 100644 --- a/include/dcommon.idl +++ b/include/dcommon.idl @@ -61,3 +61,23 @@ typedef struct D2D_SIZE_U UINT32 width; UINT32 height; } D2D_SIZE_U, D2D1_SIZE_U; + +typedef struct D2D_MATRIX_4X4_F +{ + float _11; + float _12; + float _13; + float _14; + float _21; + float _22; + float _23; + float _24; + float _31; + float _32; + float _33; + float _34; + float _41; + float _42; + float _43; + float _44; +} D2D_MATRIX_4X4_F;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/device.c | 784 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 782 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 67b3fab906..63941dca3d 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -38,11 +38,23 @@ struct d2d_draw_text_layout_ctx D2D1_DRAW_TEXT_OPTIONS options; };
+struct d2d_device_context +{ + ID2D1DeviceContext ID2D1DeviceContext_iface; + LONG refcount; + struct d2d_device *device; +}; + static inline struct d2d_device *impl_from_ID2D1Device(ID2D1Device *iface) { return CONTAINING_RECORD(iface, struct d2d_device, ID2D1Device_iface); }
+static inline struct d2d_device_context *impl_from_ID2D1DeviceContext(ID2D1DeviceContext *iface) +{ + return CONTAINING_RECORD(iface, struct d2d_device_context, ID2D1DeviceContext_iface); +} + static ID2D1Brush *d2d_draw_get_text_brush(struct d2d_draw_text_layout_ctx *context, IUnknown *effect) { ID2D1Brush *brush = NULL; @@ -3295,6 +3307,763 @@ HRESULT d2d_d3d_render_target_create_rtv(ID2D1RenderTarget *iface, IDXGISurface1 return S_OK; }
+static HRESULT WINAPI d2d_device_context_QueryInterface(ID2D1DeviceContext *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID2D1DeviceContext) + || IsEqualGUID(iid, &IID_ID2D1RenderTarget) + || IsEqualGUID(iid, &IID_ID2D1Resource) + || IsEqualGUID(iid, &IID_IUnknown)) + { + ID2D1DeviceContext_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d2d_device_context_AddRef(ID2D1DeviceContext *iface) +{ + struct d2d_device_context *device_context = impl_from_ID2D1DeviceContext(iface); + ULONG refcount = InterlockedIncrement(&device_context->refcount); + + TRACE("%p increasing refcount to %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI d2d_device_context_Release(ID2D1DeviceContext *iface) +{ + struct d2d_device_context *device_context = impl_from_ID2D1DeviceContext(iface); + ULONG refcount = InterlockedDecrement(&device_context->refcount); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + ID2D1Device_Release(&device_context->device->ID2D1Device_iface); + heap_free(device_context); + } + + return refcount; +} + +static void WINAPI d2d_device_context_GetFactory(ID2D1DeviceContext *iface, ID2D1Factory **factory) +{ + struct d2d_device_context *device_context = impl_from_ID2D1DeviceContext(iface); + + TRACE("iface %p, factory %p.\n", iface, factory); + + *factory = (ID2D1Factory *)device_context->device->factory; + ID2D1Factory_AddRef(*factory); +} + +static HRESULT WINAPI d2d_device_context_CreateBitmap(ID2D1DeviceContext *iface, D2D1_SIZE_U size, + const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **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 WINAPI d2d_device_context_CreateBitmapFromWicBitmap(ID2D1DeviceContext *iface, + IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) +{ + FIXME("iface %p, bitmap_source %p, desc %p, bitmap %p stub!\n", iface, bitmap_source, desc, bitmap); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateSharedBitmap(ID2D1DeviceContext *iface, REFIID iid, void *data, + const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) +{ + FIXME("iface %p, iid %s, data %p, desc %p, bitmap %p stub!\n", iface, debugstr_guid(iid), data, desc, bitmap); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateBitmapBrush(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, + const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, + ID2D1BitmapBrush **brush) +{ + FIXME("iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p stub!\n", iface, bitmap, + bitmap_brush_desc, brush_desc, brush); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateSolidColorBrush(ID2D1DeviceContext *iface, const D2D1_COLOR_F *color, + const D2D1_BRUSH_PROPERTIES *desc, ID2D1SolidColorBrush **brush) +{ + FIXME("iface %p, color %p, desc %p, brush %p stub!\n", iface, color, desc, brush); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateGradientStopCollection(ID2D1DeviceContext *iface, + const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, + ID2D1GradientStopCollection **gradient) +{ + FIXME("iface %p, stops %p, stop_count %u, gamma %d, extend_mode %d, gradient %p stub!\n", iface, stops, stop_count, + gamma, extend_mode, gradient); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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) +{ + FIXME("iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p stub!\n", iface, + gradient_brush_desc, brush_desc, gradient, brush); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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) +{ + FIXME("iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p stub!\n", iface, + gradient_brush_desc, brush_desc, gradient, brush); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 **render_target) +{ + FIXME("iface %p, size %p, pixel_size %p, format %p, options %u, render_target %p stub!\n", iface, + size, pixel_size, format, options, render_target); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateLayer(ID2D1DeviceContext *iface, const D2D1_SIZE_F *size, + ID2D1Layer **layer) +{ + FIXME("iface %p, size %p, layer %p stub!\n", iface, size, layer); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateMesh(ID2D1DeviceContext *iface, ID2D1Mesh **mesh) +{ + FIXME("iface %p, mesh %p stub!\n", iface, mesh); + return E_NOTIMPL; +} + +static void WINAPI d2d_device_context_DrawLine(ID2D1DeviceContext *iface, D2D1_POINT_2F p0, D2D1_POINT_2F p1, + ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, p0 {%.8e, %.8e}, p1 {%.8e, %.8e}, brush %p, stroke_width %.8e, stroke_style %p stub!\n", iface, + p0.x, p0.y, p1.x, p1.y, brush, stroke_width, stroke_style); +} + +static void WINAPI d2d_device_context_DrawRectangle(ID2D1DeviceContext *iface, const D2D1_RECT_F *rect, + ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, rect %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", iface, rect, brush, stroke_width, + stroke_style); +} + +static void WINAPI d2d_device_context_FillRectangle(ID2D1DeviceContext *iface, const D2D1_RECT_F *rect, + ID2D1Brush *brush) +{ + FIXME("iface %p, rect %p, brush %p stub!\n", iface, rect, brush); +} + +static void WINAPI d2d_device_context_DrawRoundedRectangle(ID2D1DeviceContext *iface, const D2D1_ROUNDED_RECT *rect, + ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, rect %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", iface, rect, brush, stroke_width, + stroke_style); +} + +static void WINAPI d2d_device_context_FillRoundedRectangle(ID2D1DeviceContext *iface, const D2D1_ROUNDED_RECT *rect, + ID2D1Brush *brush) +{ + FIXME("iface %p, rect %p, brush %p stub!\n", iface, rect, brush); +} + +static void WINAPI d2d_device_context_DrawEllipse(ID2D1DeviceContext *iface, const D2D1_ELLIPSE *ellipse, + ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, ellipse %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", iface, ellipse, brush, + stroke_width, stroke_style); +} + +static void WINAPI d2d_device_context_FillEllipse(ID2D1DeviceContext *iface, const D2D1_ELLIPSE *ellipse, + ID2D1Brush *brush) +{ + FIXME("iface %p, ellipse %p, brush %p stub!\n", iface, ellipse, brush); +} + +static void WINAPI d2d_device_context_DrawGeometry(ID2D1DeviceContext *iface, ID2D1Geometry *geometry, + ID2D1Brush *brush, float stroke_width, ID2D1StrokeStyle *stroke_style) +{ + FIXME("iface %p, geometry %p, brush %p, stroke_width %.8e, stroke_style %p stub!\n", iface, geometry, + brush, stroke_width, stroke_style); +} + +static void WINAPI d2d_device_context_FillGeometry(ID2D1DeviceContext *iface, ID2D1Geometry *geometry, + ID2D1Brush *brush, ID2D1Brush *opacity_brush) +{ + FIXME("iface %p, geometry %p, brush %p, opacity_brush %p stub!\n", iface, geometry, brush, opacity_brush); +} + +static void WINAPI d2d_device_context_FillMesh(ID2D1DeviceContext *iface, ID2D1Mesh *mesh, ID2D1Brush *brush) +{ + FIXME("iface %p, mesh %p, brush %p stub!\n", iface, mesh, brush); +} + +static void WINAPI 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) +{ + FIXME("iface %p, mask %p, brush %p, content %d, dst_rect %p, src_rect %p stub!\n", iface, mask, brush, content, + dst_rect, src_rect); +} + +static void WINAPI 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) +{ + FIXME("iface %p, bitmap %p, dst_rect %p, opacity %.8e, interpolation_mode %d, src_rect %p stub!\n", iface, bitmap, + dst_rect, opacity, interpolation_mode, src_rect); +} + +static void WINAPI 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) +{ + FIXME("iface %p, string %s, string_len %u, text_format %p, layout_rect %p, brush %p, options %#x, \ + measuring_mode %d stub!\n", iface, debugstr_wn(string, string_len), string_len, text_format, layout_rect, + brush, options, measuring_mode); +} + +static void WINAPI d2d_device_context_DrawTextLayout(ID2D1DeviceContext *iface, D2D1_POINT_2F origin, + IDWriteTextLayout *layout, ID2D1Brush *brush, D2D1_DRAW_TEXT_OPTIONS options) +{ + FIXME("iface %p, origin {%.8e, %.8e}, layout %p, brush %p, options %#x stub!\n", iface, origin.x, origin.y, layout, + brush, options); +} + +static void WINAPI d2d_device_context_DrawGlyphRun(ID2D1DeviceContext *iface, D2D1_POINT_2F baseline_origin, + const DWRITE_GLYPH_RUN *glyph_run, ID2D1Brush *brush, DWRITE_MEASURING_MODE measuring_mode) +{ + FIXME("iface %p, baseline_origin {%.8e, %.8e}, glyph_run %p, brush %p, measuring_mode %d stub!\n", iface, + baseline_origin.x, baseline_origin.y, glyph_run, brush, measuring_mode); +} + +static void WINAPI d2d_device_context_SetTransform(ID2D1DeviceContext *iface, const D2D1_MATRIX_3X2_F *transform) +{ + FIXME("iface %p, transform %p stub!\n", iface, transform); +} + +static void WINAPI d2d_device_context_GetTransform(ID2D1DeviceContext *iface, D2D1_MATRIX_3X2_F *transform) +{ + FIXME("iface %p, transform %p stub!\n", iface, transform); +} + +static void WINAPI d2d_device_context_SetAntialiasMode(ID2D1DeviceContext *iface, D2D1_ANTIALIAS_MODE antialias_mode) +{ + FIXME("iface %p, antialias_mode %d stub!\n", iface, antialias_mode); +} + +static D2D1_ANTIALIAS_MODE WINAPI d2d_device_context_GetAntialiasMode(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + return D2D1_ANTIALIAS_MODE_PER_PRIMITIVE; +} + +static void WINAPI d2d_device_context_SetTextAntialiasMode(ID2D1DeviceContext *iface, + D2D1_TEXT_ANTIALIAS_MODE antialias_mode) +{ + FIXME("iface %p, antialias_mode %d stub!\n", iface, antialias_mode); +} + +static D2D1_TEXT_ANTIALIAS_MODE WINAPI d2d_device_context_GetTextAntialiasMode(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + return D2D1_TEXT_ANTIALIAS_MODE_DEFAULT; +} + +static void WINAPI d2d_device_context_SetTextRenderingParams(ID2D1DeviceContext *iface, + IDWriteRenderingParams *text_rendering_params) +{ + FIXME("iface %p, text_rendering_params %p stub!\n", iface, text_rendering_params); +} + +static void WINAPI d2d_device_context_GetTextRenderingParams(ID2D1DeviceContext *iface, + IDWriteRenderingParams **text_rendering_params) +{ + FIXME("iface %p, text_rendering_params %p stub!\n", iface, text_rendering_params); +} + +static void WINAPI d2d_device_context_SetTags(ID2D1DeviceContext *iface, D2D1_TAG tag1, D2D1_TAG tag2) +{ + FIXME("iface %p, tag1 %s, tag2 %s stub!\n", iface, wine_dbgstr_longlong(tag1), wine_dbgstr_longlong(tag2)); +} + +static void WINAPI d2d_device_context_GetTags(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) +{ + FIXME("iface %p, tag1 %p, tag2 %p stub!\n", iface, tag1, tag2); +} + +static void WINAPI 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 WINAPI d2d_device_context_PopLayer(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static HRESULT WINAPI 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 WINAPI d2d_device_context_SaveDrawingState(ID2D1DeviceContext *iface, ID2D1DrawingStateBlock *state_block) +{ + FIXME("iface %p, state_block %p stub!\n", iface, state_block); +} + +static void WINAPI d2d_device_context_RestoreDrawingState(ID2D1DeviceContext *iface, + ID2D1DrawingStateBlock *state_block) +{ + FIXME("iface %p, state_block %p stub!\n", iface, state_block); +} + +static void WINAPI d2d_device_context_PushAxisAlignedClip(ID2D1DeviceContext *iface, + const D2D1_RECT_F *clip_rect, D2D1_ANTIALIAS_MODE antialias_mode) +{ + FIXME("iface %p, clip_rect %p, antialias_mode %d stub!\n", iface, clip_rect, antialias_mode); +} + +static void WINAPI d2d_device_context_PopAxisAlignedClip(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static void WINAPI d2d_device_context_Clear(ID2D1DeviceContext *iface, const D2D1_COLOR_F *color) +{ + FIXME("iface %p, color %p stub!\n", iface, color); +} + +static void WINAPI d2d_device_context_BeginDraw(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static HRESULT WINAPI d2d_device_context_EndDraw(ID2D1DeviceContext *iface, D2D1_TAG *tag1, D2D1_TAG *tag2) +{ + FIXME("iface %p, tag1 %p, tag2 %p stub!\n", iface, tag1, tag2); + return E_NOTIMPL; +} + +static D2D1_PIXEL_FORMAT * WINAPI d2d_device_context_GetPixelFormat(ID2D1DeviceContext *iface, + D2D1_PIXEL_FORMAT *format) +{ + FIXME("iface %p, format %p stub!\n", iface, format); + return NULL; +} + +static void WINAPI d2d_device_context_SetDpi(ID2D1DeviceContext *iface, float dpi_x, float dpi_y) +{ + FIXME("iface %p, dpi_x %.8e, dpi_y %.8e stub!\n", iface, dpi_x, dpi_y); +} + +static void WINAPI d2d_device_context_GetDpi(ID2D1DeviceContext *iface, float *dpi_x, float *dpi_y) +{ + FIXME("iface %p, dpi_x %p, dpi_y %p stub!\n", iface, dpi_x, dpi_y); +} + +static D2D1_SIZE_F * WINAPI d2d_device_context_GetSize(ID2D1DeviceContext *iface, D2D1_SIZE_F *size) +{ + FIXME("iface %p, size %p stub!\n", iface, size); + return NULL; +} + +static D2D1_SIZE_U * WINAPI d2d_device_context_GetPixelSize(ID2D1DeviceContext *iface, D2D1_SIZE_U *size) +{ + FIXME("iface %p, size %p stub!\n", iface, size); + return NULL; +} + +static UINT32 WINAPI d2d_device_context_GetMaximumBitmapSize(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + return 0; +} + +static BOOL WINAPI d2d_device_context_IsSupported(ID2D1DeviceContext *iface, const D2D1_RENDER_TARGET_PROPERTIES *desc) +{ + FIXME("iface %p, desc %p stub!\n", iface, desc); + return FALSE; +} + +static HRESULT WINAPI d2d_device_context_CreateBitmap_(ID2D1DeviceContext *iface, D2D1_SIZE_U size, + const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES1 *bitmap_desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, size {%u, %u}, src_data %p, pitch %u, bitmap_desc %p, bitmap %p stub!\n", iface, + size.width, size.height, src_data, pitch, bitmap_desc, bitmap); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_CreateBitmapFromWicBitmap_(ID2D1DeviceContext *iface, + IWICBitmapSource *wic_bitmap_source, const D2D1_BITMAP_PROPERTIES1 *bitmap_desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, wic_bitmap_source %p, bitmap_desc %p, bitmap %p stub!\n", iface, wic_bitmap_source, + bitmap_desc, bitmap); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 WINAPI 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 WINAPI 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 WINAPI d2d_device_context_CreateBitmapFromDxgiSurface(ID2D1DeviceContext *iface, IDXGISurface *surface, + const D2D1_BITMAP_PROPERTIES1 *bitmap_desc, ID2D1Bitmap1 **bitmap) +{ + FIXME("iface %p, surface %p, bitmap_desc %p, bitmap %p stub!\n", iface, surface, bitmap_desc, bitmap); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 WINAPI d2d_device_context_CreateGradientStopCollection_(ID2D1DeviceContext *iface, + const D2D1_GRADIENT_STOP *stops, UINT 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_mode %d, postinterpolation_mode %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 WINAPI 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 WINAPI d2d_device_context_CreateBitmapBrush_(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, + const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, + ID2D1BitmapBrush1 **brush) +{ + FIXME("iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p stub!\n", iface, bitmap, + bitmap_brush_desc, brush_desc, brush); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 WINAPI d2d_device_context_IsDxgiFormatSupported(ID2D1DeviceContext *iface, DXGI_FORMAT format) +{ + FIXME("iface %p, format %d stub!\n", iface, format); + return FALSE; +} + +static BOOL WINAPI 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 WINAPI d2d_device_context_GetImageLocalBounds(ID2D1DeviceContext *iface, ID2D1Image *image, + D2D1_RECT_F *bounds) +{ + FIXME("iface %p, image %p, bounds %p stub!\n", iface, image, bounds); +} + +static HRESULT WINAPI d2d_device_context_GetImageWorldBounds(ID2D1DeviceContext *iface, ID2D1Image *image, + D2D1_RECT_F *bounds) +{ + FIXME("iface %p, image %p, bounds %p stub!\n", iface, image, bounds); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 WINAPI d2d_device_context_GetDevice(ID2D1DeviceContext *iface, ID2D1Device **device) +{ + struct d2d_device_context *device_context = impl_from_ID2D1DeviceContext(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = &device_context->device->ID2D1Device_iface; + ID2D1Device_AddRef(*device); +} + +static void WINAPI d2d_device_context_SetTarget(ID2D1DeviceContext *iface, ID2D1Image *target) +{ + FIXME("iface %p, target %p stub!\n", iface, target); +} + +static void WINAPI d2d_device_context_GetTarget(ID2D1DeviceContext *iface, ID2D1Image **target) +{ + FIXME("iface %p, target %p stub!\n", iface, target); +} + +static void WINAPI 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 WINAPI d2d_device_context_GetRenderingControls(ID2D1DeviceContext *iface, + D2D1_RENDERING_CONTROLS *rendering_controls) +{ + FIXME("iface %p, rendering_controls %p stub!\n", iface, rendering_controls); +} + +static void WINAPI 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 WINAPI d2d_device_context_GetPrimitiveBlend(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + return D2D1_PRIMITIVE_BLEND_SOURCE_OVER; +} + +static void WINAPI 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 WINAPI d2d_device_context_GetUnitMode(ID2D1DeviceContext *iface) +{ + FIXME("iface %p stub!\n", iface); + return D2D1_UNIT_MODE_DIPS; +} + +static void WINAPI 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 WINAPI 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 WINAPI 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 WINAPI d2d_device_context_DrawBitmap_(ID2D1DeviceContext *iface, ID2D1Bitmap *bitmap, + const D2D1_RECT_F *dest_rect, float opacity, D2D1_INTERPOLATION_MODE interpolation_mode, + const D2D1_RECT_F *src_rect, const D2D1_MATRIX_4X4_F *transform) +{ + FIXME("iface %p, bitmap %p, dest_rect %p, opacity %.8e, interpolation_mode %d, src_rect %p, \ + transform %p stub!\n", iface, bitmap, dest_rect, opacity, interpolation_mode, src_rect, transform); +} + +static void WINAPI 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 WINAPI d2d_device_context_InvalidateEffectInputRectangle(ID2D1DeviceContext *iface, + ID2D1Effect *effect, UINT32 input, const D2D1_RECT_F *rect) +{ + FIXME("iface %p, effect %p, input %u, rect %p stub!\n", iface, effect, input, rect); + return E_NOTIMPL; +} + +static HRESULT WINAPI 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 WINAPI d2d_device_context_GetEffectInvalidRectangles(ID2D1DeviceContext *iface, ID2D1Effect *effect, + D2D1_RECT_F *rects, UINT32 rect_count) +{ + FIXME("iface %p, effect %p, rects %p, rect_count %u stub!\n", iface, effect, rects, rect_count); + return E_NOTIMPL; +} + +static HRESULT WINAPI d2d_device_context_GetEffectRequiredInputRectangles(ID2D1DeviceContext *iface, + ID2D1Effect *effect, const D2D1_RECT_F *image_rect, const D2D1_EFFECT_INPUT_DESCRIPTION *input_desc, + D2D1_RECT_F *required_rects, UINT32 input_count) +{ + FIXME("iface %p, effect %p, image_rect %p, input_desc %p, required_rects %p, input_count %u stub!\n", iface, + effect, image_rect, input_desc, required_rects, input_count); + return E_NOTIMPL; +} + +static void WINAPI d2d_device_context_ID2D1DeviceContext_FillOpacityMask( + ID2D1DeviceContext *iface, + ID2D1Bitmap *opacityMask, + ID2D1Brush *brush, + const D2D1_RECT_F *destinationRectangle, + const D2D1_RECT_F *sourceRectangle) +{ + struct d2d_device_context *This = impl_from_ID2D1DeviceContext(iface); + FIXME("%p stub!\n", This); +} + +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_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_ID2D1DeviceContext_FillOpacityMask, +}; + +static void d2d_device_context_init(struct d2d_device_context *device_context, struct d2d_device *device) +{ + device_context->ID2D1DeviceContext_iface.lpVtbl = &d2d_device_context_vtbl; + device_context->refcount = 1; + device_context->device = device; + ID2D1Device_AddRef(&device->ID2D1Device_iface); +} + static HRESULT WINAPI d2d_device_QueryInterface(ID2D1Device *iface, REFIID iid, void **out) { TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); @@ -3354,9 +4123,20 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device *iface, ID2D1Factory **fact static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext **context) { - FIXME("iface %p, options %#x, context %p stub!\n", iface, options, context); + struct d2d_device *device = impl_from_ID2D1Device(iface); + struct d2d_device_context *object;
- return E_NOTIMPL; + TRACE("iface %p, options %#x, context %p.\n", iface, options, context); + + if (!(object = heap_alloc_zero(sizeof(*object)))) + return E_OUTOFMEMORY; + + d2d_device_context_init(object, device); + + TRACE("Created device context %p.\n", object); + *context = &object->ID2D1DeviceContext_iface; + + return S_OK; }
static HRESULT WINAPI d2d_device_CreatePrintControl(ID2D1Device *iface, IWICImagingFactory *wic_factory,
On 26 May 2018 at 11:17, Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d2d1/device.c | 784 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 782 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 67b3fab906..63941dca3d 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -38,11 +38,23 @@ struct d2d_draw_text_layout_ctx D2D1_DRAW_TEXT_OPTIONS options; };
+struct d2d_device_context +{
- ID2D1DeviceContext ID2D1DeviceContext_iface;
- LONG refcount;
- struct d2d_device *device;
+};
Since ID2D1DeviceContext extends ID2D1RenderTarget, should this implementation really be separate from the d2d_d3d_render_target implementation?
On Tue, 29 May 2018 at 10:01, Henri Verbeet hverbeet@gmail.com wrote:
On 26 May 2018 at 11:17, Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d2d1/device.c | 784 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 782 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 67b3fab906..63941dca3d 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -38,11 +38,23 @@ struct d2d_draw_text_layout_ctx D2D1_DRAW_TEXT_OPTIONS options; };
+struct d2d_device_context +{
- ID2D1DeviceContext ID2D1DeviceContext_iface;
- LONG refcount;
- struct d2d_device *device;
+};
Since ID2D1DeviceContext extends ID2D1RenderTarget, should this implementation really be separate from the d2d_d3d_render_target implementation?
Context can render in two ways - populating command list, or rendering to a bitmap object. I was thinking we should create a dxgi target when rendering to a bitmap and forward calls to it. For command lists we don’t need to create a real target.
On 29 May 2018 at 22:09, Nikolay Sivov bunglehead@gmail.com wrote:
Context can render in two ways - populating command list, or rendering to a bitmap object. I was thinking we should create a dxgi target when rendering to a bitmap and forward calls to it. For command lists we don’t need to create a real target.
Yeah, but I think we'd still like things to work in essentially the same way. When rendering to a command list, we'd record commands for later execution. When rendering to a surface we'd do the same, but also start execution (more or less) immediately, potentially on a different thread.
On Sun, 3 Jun 2018 at 14:43, Henri Verbeet hverbeet@gmail.com wrote:
On 29 May 2018 at 22:09, Nikolay Sivov bunglehead@gmail.com wrote:
Context can render in two ways - populating command list, or rendering
to a
bitmap object. I was thinking we should create a dxgi target when
rendering
to a bitmap and forward calls to it. For command lists we don’t need to create a real target.
Yeah, but I think we'd still like things to work in essentially the same way. When rendering to a command list, we'd record commands for later execution. When rendering to a surface we'd do the same, but also start execution (more or less) immediately, potentially on a different thread.
Does that imply moving d3d target to such model first? It also looks like a way to make Flush() do something.