wined3d: Introduce wined3d_texture_release_dc().

Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Riccardo Bortolato 2015-10-28 14:02:13 +01:00 committed by Alexandre Julliard
parent a2f2d238d4
commit 96dd793756
4 changed files with 21 additions and 1 deletions

View File

@ -311,7 +311,7 @@ static HRESULT WINAPI d3d9_surface_ReleaseDC(IDirect3DSurface9 *iface, HDC dc)
TRACE("iface %p, dc %p.\n", iface, dc);
wined3d_mutex_lock();
hr = wined3d_surface_releasedc(surface->wined3d_surface, dc);
hr = wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, dc);
wined3d_mutex_unlock();
switch (hr)

View File

@ -1558,3 +1558,21 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
return wined3d_surface_getdc(surface_from_resource(sub_resource), dc);
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
{
struct wined3d_resource *sub_resource;
TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc);
if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)))
return WINED3DERR_INVALIDCALL;
if (sub_resource->type != WINED3D_RTYPE_SURFACE)
{
WARN("Not supported on %s resources.\n", debug_d3dresourcetype(texture->resource.type));
return WINED3DERR_INVALIDCALL;
}
return wined3d_surface_releasedc(surface_from_resource(sub_resource), dc);
}

View File

@ -270,6 +270,7 @@
@ cdecl wined3d_texture_get_sub_resource(ptr long)
@ cdecl wined3d_texture_incref(ptr)
@ cdecl wined3d_texture_preload(ptr)
@ cdecl wined3d_texture_release_dc(ptr long ptr)
@ cdecl wined3d_texture_set_autogen_filter_type(ptr long)
@ cdecl wined3d_texture_set_color_key(ptr long ptr)
@ cdecl wined3d_texture_set_lod(ptr long)

View File

@ -2553,6 +2553,7 @@ HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture,
DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod);
HRESULT __cdecl wined3d_texture_map(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc);
HRESULT __cdecl wined3d_texture_unmap(struct wined3d_texture *texture, unsigned int sub_resource_idx);
HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture,
UINT width, UINT height, enum wined3d_format_id format_id,