Module: wine Branch: master Commit: 4e610f059dc070296bcfc9e71cecde793385a77c URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e610f059dc070296bcfc9e71c...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Nov 22 17:21:05 2017 +0300
d2d1: Respond to ID2D1Image query.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d2d1/bitmap.c | 1 + dlls/d2d1/tests/d2d1.c | 6 ++++++ 2 files changed, 7 insertions(+)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index 6d9c352..b03482a 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -34,6 +34,7 @@ static HRESULT STDMETHODCALLTYPE d2d_bitmap_QueryInterface(ID2D1Bitmap *iface, R TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_ID2D1Bitmap) + || IsEqualGUID(iid, &IID_ID2D1Image) || IsEqualGUID(iid, &IID_ID2D1Resource) || IsEqualGUID(iid, &IID_IUnknown)) { diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 3a28e38..5116d78 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -1476,6 +1476,7 @@ static void test_bitmap_brush(void) IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F color; + ID2D1Image *image; D2D1_SIZE_U size; unsigned int i; ULONG refcount; @@ -1535,6 +1536,11 @@ static void test_bitmap_brush(void) hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap); ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+ hr = ID2D1Bitmap_QueryInterface(bitmap, &IID_ID2D1Image, (void **)&image); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Vista */, "Failed to get ID2D1Image, hr %#x.\n", hr); + if (hr == S_OK) + ID2D1Image_Release(image); + /* Creating a brush with a NULL bitmap crashes on Vista, but works fine on * Windows 7+. */ hr = ID2D1RenderTarget_CreateBitmapBrush(rt, bitmap, NULL, NULL, &brush);