[PATCH v3 2/3] d2d1: Implement ID2D1Bitmap1::Unmap().
Dmitry Timoshkov
dmitry at baikal.ru
Fri May 27 04:22:50 CDT 2022
v3: Don't Unmap on Release.
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 a75a9be62be..9d9d980b4c9 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -285,9 +285,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 D2DERR_WRONG_STATE;
+
+ 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.36.1
More information about the wine-devel
mailing list