Nikolay Sivov : d2d1: Derive bitmap options from surface description in CreateSharedBitmap().

Alexandre Julliard julliard at winehq.org
Tue May 31 15:58:00 CDT 2022


Module: wine
Branch: master
Commit: a3273a585aef1b2a8d56f865c0daecabced8f482
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a3273a585aef1b2a8d56f865c0daecabced8f482

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon May 30 10:18:20 2022 +0300

d2d1: Derive bitmap options from surface description in CreateSharedBitmap().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>

---

 dlls/d2d1/bitmap.c     | 1 +
 dlls/d2d1/device.c     | 5 ++++-
 dlls/d2d1/tests/d2d1.c | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index 097d984e3ae..cebabbe4a61 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -616,6 +616,7 @@ HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid,
         {
             memset(&d, 0, sizeof(d));
             d.pixelFormat.format = surface_desc.Format;
+            d.bitmapOptions = d2d_get_bitmap_options_for_surface(surface);
         }
         else
         {
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 64b573da974..b7faf33e266 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -405,7 +405,10 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateSharedBitmap(ID2D1Devi
     if (desc)
     {
         memcpy(&bitmap_desc, desc, sizeof(*desc));
-        bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
+        if (IsEqualIID(iid, &IID_IDXGISurface) || IsEqualIID(iid, &IID_IDXGISurface1))
+            bitmap_desc.bitmapOptions = d2d_get_bitmap_options_for_surface(data);
+        else
+            bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
         bitmap_desc.colorContext = NULL;
     }
 
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 515c14e5adb..5185c07c29b 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -11772,7 +11772,6 @@ static void test_bitmap_map(BOOL d3d11)
     hr = ID2D1Bitmap_QueryInterface(bitmap2, &IID_ID2D1Bitmap1, (void **)&bitmap);
     ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     options = ID2D1Bitmap1_GetOptions(bitmap);
-    todo_wine
     ok(options == (D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ),
             "Unexpected options %#x.\n", options);
 




More information about the wine-cvs mailing list