[PATCH 2/2] d2d1: Implement ID2D1Bitmap1::Unmap().

Dmitry Timoshkov dmitry at baikal.ru
Thu May 12 08:23:21 CDT 2022


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/d2d1/bitmap.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index bab3575c431..579f942b919 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -297,9 +297,23 @@ static HRESULT STDMETHODCALLTYPE d2d_bitmap_Map(ID2D1Bitmap1 *iface, D2D1_MAP_OP
 
 static HRESULT STDMETHODCALLTYPE d2d_bitmap_Unmap(ID2D1Bitmap1 *iface)
 {
-    FIXME("iface %p stub!\n", iface);
+    struct d2d_bitmap *bitmap = impl_from_ID2D1Bitmap1(iface);
+    ID3D11Device *device;
+    ID3D11DeviceContext *context;
 
-    return E_NOTIMPL;
+    TRACE("iface %p.\n", iface);
+
+    if (!bitmap->staging_resource)
+        return E_INVALIDARG;
+
+    ID3D11Resource_GetDevice(bitmap->resource, &device);
+    ID3D11Device_GetImmediateContext(device, &context);
+    ID3D11DeviceContext_Unmap(context, bitmap->staging_resource, 0);
+    bitmap->staging_resource = NULL;
+    ID3D11DeviceContext_Release(context);
+    ID3D11Device_Release(device);
+
+    return S_OK;
 }
 
 static const struct ID2D1Bitmap1Vtbl d2d_bitmap_vtbl =
-- 
2.35.3




More information about the wine-devel mailing list