Commit 96658847 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Don't map the surface in getdc.

This avoids bouncing the content between the map binding and DIB.
parent adf0ab2a
...@@ -3219,7 +3219,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, ...@@ -3219,7 +3219,6 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
{ {
struct wined3d_map_desc map;
HRESULT hr; HRESULT hr;
TRACE("surface %p, dc %p.\n", surface, dc); TRACE("surface %p, dc %p.\n", surface, dc);
...@@ -3245,14 +3244,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) ...@@ -3245,14 +3244,6 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
/* Map the surface. */
hr = wined3d_surface_map(surface, &map, NULL, 0);
if (FAILED(hr))
{
ERR("Map failed, hr %#x.\n", hr);
return hr;
}
surface_load_location(surface, SFLAG_INDIB); surface_load_location(surface, SFLAG_INDIB);
surface_invalidate_location(surface, ~SFLAG_INDIB); surface_invalidate_location(surface, ~SFLAG_INDIB);
...@@ -3294,6 +3285,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) ...@@ -3294,6 +3285,7 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc)
} }
surface->flags |= SFLAG_DCINUSE; surface->flags |= SFLAG_DCINUSE;
surface->resource.map_count++;
*dc = surface->hDC; *dc = surface->hDC;
TRACE("Returning dc %p.\n", *dc); TRACE("Returning dc %p.\n", *dc);
...@@ -3315,8 +3307,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) ...@@ -3315,8 +3307,7 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
return WINEDDERR_NODC; return WINEDDERR_NODC;
} }
wined3d_surface_unmap(surface); surface->resource.map_count--;
surface->flags &= ~SFLAG_DCINUSE; surface->flags &= ~SFLAG_DCINUSE;
if (surface->map_binding == SFLAG_INUSERMEM) if (surface->map_binding == SFLAG_INUSERMEM)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment