d2d1: Fix bind flags used for bitmap resources.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-10-02 09:33:06 +03:00 committed by Alexandre Julliard
parent d227553f57
commit f2429e3109
2 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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);