36 UINT dst_size, dst_pitch;
44 &IID_ID3D10Resource, (
void **)&src_resource)))
46 ERR(
"Failed to get source resource interface, hr %#lx.\n",
hr);
52 ID3D10Device_Release(
device);
53 ID3D10Resource_Release(src_resource);
61 ERR(
"Failed to lock destination bitmap, hr %#lx.\n",
hr);
65 if (
FAILED(
hr = IWICBitmapLock_GetDataPointer(bitmap_lock, &dst_size, &
dst)))
67 ERR(
"Failed to get data pointer, hr %#lx.\n",
hr);
68 IWICBitmapLock_Release(bitmap_lock);
72 if (
FAILED(
hr = IWICBitmapLock_GetStride(bitmap_lock, &dst_pitch)))
74 ERR(
"Failed to get stride, hr %#lx.\n",
hr);
75 IWICBitmapLock_Release(bitmap_lock);
81 ERR(
"Failed to map readback texture, hr %#lx.\n",
hr);
82 IWICBitmapLock_Release(bitmap_lock);
88 for (
i = 0;
i < render_target->
height; ++
i)
96 IWICBitmapLock_Release(bitmap_lock);
108 return IUnknown_QueryInterface(render_target->
dxgi_inner, iid,
out);
130 IWICBitmap_Release(render_target->
bitmap);
165 WARN(
"Failed to get bitmap dimensions, hr %#lx.\n",
hr);
174 texture_desc.
Format =
desc->pixelFormat.format;
179 if (
FAILED(
hr = IWICBitmap_GetPixelFormat(
bitmap, &bitmap_format)))
181 WARN(
"Failed to get bitmap format, hr %#lx.\n",
hr);
185 if (
IsEqualGUID(&bitmap_format, &GUID_WICPixelFormat32bppPBGRA)
186 ||
IsEqualGUID(&bitmap_format, &GUID_WICPixelFormat32bppBGR))
190 else if (
IsEqualGUID(&bitmap_format, &GUID_WICPixelFormat32bppPRGBA)
191 ||
IsEqualGUID(&bitmap_format, &GUID_WICPixelFormat32bppRGB))
202 switch (texture_desc.
Format)
206 render_target->
bpp = 4;
210 FIXME(
"Unhandled format %#x.\n", texture_desc.
Format);
224 WARN(
"Failed to create texture, hr %#lx.\n",
hr);
228 hr = ID3D10Texture2D_QueryInterface(
texture, &IID_IDXGISurface, (
void **)&render_target->
dxgi_surface);
229 ID3D10Texture2D_Release(
texture);
232 WARN(
"Failed to get DXGI surface interface, hr %#lx.\n",
hr);
243 WARN(
"Failed to create readback texture, hr %#lx.\n",
hr);
250 WARN(
"Failed to get DXGI device, hr %#lx.\n",
hr);
259 WARN(
"Failed to create D2D device, hr %#lx.\n",
hr);
267 ID2D1Device_Release(
device);
270 WARN(
"Failed to create DXGI surface render target, hr %#lx.\n",
hr);
277 &IID_ID2D1RenderTarget, (
void **)&render_target->
dxgi_target)))
279 WARN(
"Failed to retrieve ID2D1RenderTarget interface, hr %#lx.\n",
hr);
287 IWICBitmap_AddRef(
bitmap);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define STDMETHODCALLTYPE
@ D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE
struct d2d_device * unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface)
HRESULT d2d_d3d_create_render_target(struct d2d_device *device, IDXGISurface *surface, IUnknown *outer_unknown, const struct d2d_device_context_ops *ops, const D2D1_RENDER_TARGET_PROPERTIES *desc, void **render_target)
HRESULT d2d_factory_create_device(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, bool allow_get_dxgi_device, REFIID iid, void **device)
#define D2DERR_UNSUPPORTED_PIXEL_FORMAT
@ D3D10_RESOURCE_MISC_GDI_COMPATIBLE
@ D3D10_BIND_SHADER_RESOURCE
@ D3D10_BIND_RENDER_TARGET
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
#define IsEqualGUID(rguid1, rguid2)
DXGI_SAMPLE_DESC SampleDesc
ID3D10Texture2D * readback_texture
ID2D1RenderTarget * dxgi_target
IDXGISurface * dxgi_surface
#define CONTAINING_RECORD(address, type, field)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
static const struct IUnknownVtbl d2d_wic_render_target_vtbl
static ULONG STDMETHODCALLTYPE d2d_wic_render_target_Release(IUnknown *iface)
static HRESULT d2d_wic_render_target_present(IUnknown *outer_unknown)
static const struct d2d_device_context_ops d2d_wic_render_target_ops
static struct d2d_wic_render_target * impl_from_IUnknown(IUnknown *iface)
static ULONG STDMETHODCALLTYPE d2d_wic_render_target_AddRef(IUnknown *iface)
HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, ID2D1Factory1 *factory, ID3D10Device1 *d3d_device, IWICBitmap *bitmap, const D2D1_RENDER_TARGET_PROPERTIES *desc)
static HRESULT STDMETHODCALLTYPE d2d_wic_render_target_QueryInterface(IUnknown *iface, REFIID iid, void **out)