Module: wine Branch: master Commit: 93959d21e97b007562f7d7a507c5f0d65b376439 URL: http://source.winehq.org/git/wine.git/?a=commit;h=93959d21e97b007562f7d7a507...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Feb 16 18:09:21 2017 +0300
d2d1/tests: Test to show that WIC bitmap is locked within BeginDraw()/EndDraw().
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/tests/d2d1.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 5c6f346..19efd73 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -3971,6 +3971,7 @@ static void test_gdi_interop(void) ID2D1GdiInteropRenderTarget *interop; D2D1_RENDER_TARGET_PROPERTIES desc; IWICImagingFactory *wic_factory; + IWICBitmapLock *wic_lock; IWICBitmap *wic_bitmap; ID2D1RenderTarget *rt; ID2D1Factory *factory; @@ -4065,6 +4066,19 @@ todo_wine match = compare_wic_bitmap(wic_bitmap, "60cacbf3d72e1e7834203da608037b1bf83b40e8"); ok(match, "Bitmap does not match.\n");
+ /* Bitmap is locked at BeginDraw(). */ + hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock); + ok(SUCCEEDED(hr), "Expected bitmap to be unlocked, hr %#x.\n", hr); + IWICBitmapLock_Release(wic_lock); + + ID2D1RenderTarget_BeginDraw(rt); + hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock); +todo_wine + ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Expected bitmap to be locked, hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IWICBitmapLock_Release(wic_lock); + ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ID2D1GdiInteropRenderTarget_Release(interop); ID2D1RenderTarget_Release(rt);