Commit 31cbe190 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1: Add ID2D1DeviceContext stub.

parent e7949902
...@@ -337,7 +337,7 @@ HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE ...@@ -337,7 +337,7 @@ HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE
return *bitmap ? S_OK : E_OUTOFMEMORY; 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) REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap)
{ {
D2D1_BITMAP_PROPERTIES d; D2D1_BITMAP_PROPERTIES d;
...@@ -349,7 +349,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device ...@@ -349,7 +349,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
ID3D10Device *device; ID3D10Device *device;
HRESULT hr = S_OK; HRESULT hr = S_OK;
ID2D1RenderTarget_GetFactory(render_target, &factory); ID2D1DeviceContext_GetFactory(context, &factory);
if (src_impl->factory != factory) if (src_impl->factory != factory)
{ {
hr = D2DERR_WRONG_FACTORY; hr = D2DERR_WRONG_FACTORY;
...@@ -437,7 +437,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device ...@@ -437,7 +437,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
{ {
float dpi_x, dpi_y; 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) if (d.dpiX == 0.0f)
d.dpiX = dpi_x; d.dpiX = dpi_x;
if (d.dpiY == 0.0f) if (d.dpiY == 0.0f)
...@@ -454,7 +454,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device ...@@ -454,7 +454,7 @@ HRESULT d2d_bitmap_create_shared(ID2D1RenderTarget *render_target, ID3D10Device
pixel_size.width = surface_desc.Width; pixel_size.width = surface_desc.Width;
pixel_size.height = surface_desc.Height; pixel_size.height = surface_desc.Height;
ID2D1RenderTarget_GetFactory(render_target, &factory); ID2D1DeviceContext_GetFactory(context, &factory);
d2d_bitmap_init(*bitmap, factory, view, pixel_size, &d); d2d_bitmap_init(*bitmap, factory, view, pixel_size, &d);
ID3D10ShaderResourceView_Release(view); ID3D10ShaderResourceView_Release(view);
ID2D1Factory_Release(factory); ID2D1Factory_Release(factory);
......
...@@ -728,7 +728,7 @@ static const struct ID2D1BitmapRenderTargetVtbl d2d_bitmap_render_target_vtbl = ...@@ -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, 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, const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *pixel_format,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options) D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options)
{ {
......
...@@ -1087,7 +1087,7 @@ static D3D10_TEXTURE_ADDRESS_MODE texture_address_mode_from_extend_mode(D2D1_EXT ...@@ -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, 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 theta, sin_theta, cos_theta;
float dpi_scale, d, s1, s2, t, u; float dpi_scale, d, s1, s2, t, u;
...@@ -1204,7 +1204,7 @@ static BOOL d2d_brush_fill_cb(const struct d2d_brush *brush, ...@@ -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, 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; D3D10_SUBRESOURCE_DATA buffer_data;
struct d2d_ps_cb cb_data = {0}; struct d2d_ps_cb cb_data = {0};
......
...@@ -117,9 +117,9 @@ struct d2d_ps_cb ...@@ -117,9 +117,9 @@ struct d2d_ps_cb
struct d2d_brush_cb opacity_brush; struct d2d_brush_cb opacity_brush;
}; };
struct d2d_d3d_render_target struct d2d_device_context
{ {
ID2D1RenderTarget ID2D1RenderTarget_iface; ID2D1DeviceContext ID2D1DeviceContext_iface;
ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface; ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget_iface;
IDWriteTextRenderer IDWriteTextRenderer_iface; IDWriteTextRenderer IDWriteTextRenderer_iface;
LONG refcount; LONG refcount;
...@@ -210,7 +210,7 @@ struct d2d_bitmap_render_target ...@@ -210,7 +210,7 @@ struct d2d_bitmap_render_target
}; };
HRESULT d2d_bitmap_render_target_init(struct d2d_bitmap_render_target *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, const D2D1_SIZE_U *pixel_size, const D2D1_PIXEL_FORMAT *format,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options) DECLSPEC_HIDDEN; D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options) DECLSPEC_HIDDEN;
...@@ -282,7 +282,7 @@ HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap, ...@@ -282,7 +282,7 @@ HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap,
struct d2d_brush **brush) DECLSPEC_HIDDEN; struct d2d_brush **brush) DECLSPEC_HIDDEN;
void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device, unsigned int brush_idx) 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, 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_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN;
struct d2d_stroke_style struct d2d_stroke_style
...@@ -335,7 +335,7 @@ struct d2d_bitmap ...@@ -335,7 +335,7 @@ struct d2d_bitmap
HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data, 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; 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; 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, 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; const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment