On 10 February 2017 at 13:00, Nikolay Sivov nsivov@codeweavers.com wrote:
+static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_GetDC(ID2D1GdiInteropRenderTarget *iface,
D2D1_DC_INITIALIZE_MODE mode, HDC *dc)
+{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
- IDXGISurface1 *surface;
- HRESULT hr;
- TRACE("iface %p, mode %d, dc %p.\n", iface, mode, dc);
- if (FAILED(hr = d2d_d3d_render_target_get_surface(render_target, &surface)))
return hr;
- hr = IDXGISurface1_GetDC(surface, mode != D2D1_DC_INITIALIZE_MODE_COPY, dc);
- IDXGISurface1_Release(surface);
- return hr;
+}
+static HRESULT STDMETHODCALLTYPE d2d_gdi_interop_render_target_ReleaseDC(ID2D1GdiInteropRenderTarget *iface,
const RECT *update)
+{
- struct d2d_d3d_render_target *render_target = impl_from_ID2D1GdiInteropRenderTarget(iface);
- IDXGISurface1 *surface;
- HRESULT hr;
- TRACE("iface %p, update rect %s.\n", iface, wine_dbgstr_rect(update));
- if (FAILED(hr = d2d_d3d_render_target_get_surface(render_target, &surface)))
return hr;
- hr = IDXGISurface1_ReleaseDC(surface, update);
This discards "const".
- IDXGISurface1_Release(surface);
- return hr;
+}
Should this sync/flush in case of e.g. a WIC bitmap render target?