Commit 96dd7937 authored by Riccardo Bortolato's avatar Riccardo Bortolato Committed by Alexandre Julliard

wined3d: Introduce wined3d_texture_release_dc().

parent a2f2d238
...@@ -311,7 +311,7 @@ static HRESULT WINAPI d3d9_surface_ReleaseDC(IDirect3DSurface9 *iface, HDC dc) ...@@ -311,7 +311,7 @@ static HRESULT WINAPI d3d9_surface_ReleaseDC(IDirect3DSurface9 *iface, HDC dc)
TRACE("iface %p, dc %p.\n", iface, dc); TRACE("iface %p, dc %p.\n", iface, dc);
wined3d_mutex_lock(); 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(); wined3d_mutex_unlock();
switch (hr) switch (hr)
......
...@@ -1558,3 +1558,21 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i ...@@ -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); 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);
}
...@@ -270,6 +270,7 @@ ...@@ -270,6 +270,7 @@
@ cdecl wined3d_texture_get_sub_resource(ptr long) @ cdecl wined3d_texture_get_sub_resource(ptr long)
@ cdecl wined3d_texture_incref(ptr) @ cdecl wined3d_texture_incref(ptr)
@ cdecl wined3d_texture_preload(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_autogen_filter_type(ptr long)
@ cdecl wined3d_texture_set_color_key(ptr long ptr) @ cdecl wined3d_texture_set_color_key(ptr long ptr)
@ cdecl wined3d_texture_set_lod(ptr long) @ cdecl wined3d_texture_set_lod(ptr long)
......
...@@ -2553,6 +2553,7 @@ HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture, ...@@ -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); 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, 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); 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_unmap(struct wined3d_texture *texture, unsigned int sub_resource_idx);
HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture, HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture,
UINT width, UINT height, enum wined3d_format_id format_id, UINT width, UINT height, enum wined3d_format_id format_id,
......
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