Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/bitmap.c | 6 +++++- dlls/d2d1/tests/d2d1.c | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index 3948c26ec9..6eee1d1442 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -338,7 +338,11 @@ HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size, texture_desc.SampleDesc.Count = 1; texture_desc.SampleDesc.Quality = 0; texture_desc.Usage = D3D10_USAGE_DEFAULT; - texture_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; + texture_desc.BindFlags = 0; + if (desc->bitmapOptions & D2D1_BITMAP_OPTIONS_TARGET) + texture_desc.BindFlags |= D3D10_BIND_RENDER_TARGET; + if (!(desc->bitmapOptions & D2D1_BITMAP_OPTIONS_CANNOT_DRAW)) + texture_desc.BindFlags |= D3D10_BIND_SHADER_RESOURCE; texture_desc.CPUAccessFlags = 0; texture_desc.MiscFlags = 0;
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index d31c8ad97e..55d2f568f9 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -813,9 +813,8 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h if (!(options & D2D1_BITMAP_OPTIONS_CANNOT_DRAW)) bind_flags |= D3D10_BIND_SHADER_RESOURCE;
- todo_wine_if (options == D2D1_BITMAP_OPTIONS_TARGET) - ok_(__FILE__, line)(desc.BindFlags == bind_flags, "Unexpected bind flags %#x for bitmap options %#x.\n", - desc.BindFlags, options); + ok_(__FILE__, line)(desc.BindFlags == bind_flags, "Unexpected bind flags %#x for bitmap options %#x.\n", + desc.BindFlags, options); ok_(__FILE__, line)(!desc.CPUAccessFlags, "Unexpected cpu access flags %#x.\n", desc.CPUAccessFlags); ok_(__FILE__, line)(!desc.MiscFlags, "Unexpected misc flags %#x.\n", desc.MiscFlags);