[PATCH 5/6] ddraw: Replace wined3d_surface_{get, release}dc() with wined3d_texture_{get, release}_dc().
Riccardo Bortolato
rikyz619 at gmail.com
Sun Jan 31 04:22:22 CST 2016
Removed wined3d_surface_{get,release}dc from wined3d public api.
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
dlls/ddraw/surface.c | 10 +++++-----
dlls/wined3d/wined3d.spec | 2 --
dlls/wined3d/wined3d_private.h | 2 ++
include/wine/wined3d.h | 2 --
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 8e1aec4..0595b26 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -73,7 +73,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RE
surface->wined3d_surface, rect, 0, NULL, WINED3D_TEXF_POINT);
}
- if (FAILED(hr = wined3d_surface_getdc(surface->wined3d_surface, &surface_dc)))
+ if (FAILED(hr = wined3d_texture_get_dc(surface->wined3d_texture, surface->sub_resource_idx, &surface_dc)))
{
ERR("Failed to get surface DC, hr %#x.\n", hr);
return hr;
@@ -83,7 +83,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RE
if (!(screen_dc = GetDC(NULL)))
{
- wined3d_surface_releasedc(surface->wined3d_surface, surface_dc);
+ wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, surface_dc);
ERR("Failed to get screen DC.\n");
return E_FAIL;
}
@@ -96,7 +96,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RE
surface_dc, x, y, SRCCOPY);
ReleaseDC(NULL, screen_dc);
- wined3d_surface_releasedc(surface->wined3d_surface, surface_dc);
+ wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, surface_dc);
if (!ret)
{
@@ -2112,7 +2112,7 @@ static HRESULT WINAPI ddraw_surface7_GetDC(IDirectDrawSurface7 *iface, HDC *hdc)
if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
hr = ddraw_surface_update_frontbuffer(surface, NULL, TRUE);
if (SUCCEEDED(hr))
- hr = wined3d_surface_getdc(surface->wined3d_surface, hdc);
+ hr = wined3d_texture_get_dc(surface->wined3d_texture, surface->sub_resource_idx, hdc);
if (SUCCEEDED(hr) && format_is_paletteindexed(&surface->surface_desc.u4.ddpfPixelFormat))
{
@@ -2200,7 +2200,7 @@ static HRESULT WINAPI ddraw_surface7_ReleaseDC(IDirectDrawSurface7 *iface, HDC h
TRACE("iface %p, dc %p.\n", iface, hdc);
wined3d_mutex_lock();
- hr = wined3d_surface_releasedc(surface->wined3d_surface, hdc);
+ hr = wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, hdc);
if (SUCCEEDED(hr) && (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
hr = ddraw_surface_update_frontbuffer(surface, NULL, FALSE);
wined3d_mutex_unlock();
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 6cd03ac..f178866 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -227,9 +227,7 @@
@ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_resource(ptr)
-@ cdecl wined3d_surface_getdc(ptr ptr)
@ cdecl wined3d_surface_preload(ptr)
-@ cdecl wined3d_surface_releasedc(ptr ptr)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index fde1e50..7454b90 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2515,9 +2515,11 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+HRESULT wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_map(struct wined3d_surface *surface,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN;
void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+HRESULT wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 08de9f9..37ec602 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2478,9 +2478,7 @@ HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surfac
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
-HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
void __cdecl wined3d_surface_preload(struct wined3d_surface *surface);
-HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc);
HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx);
--
1.9.1
More information about the wine-patches
mailing list