Henri Verbeet : wined3d: Merge the IWineD3DSurface::PreLoad() implementations.

Alexandre Julliard julliard at winehq.org
Thu Apr 28 12:18:52 CDT 2011


Module: wine
Branch: master
Commit: 13146e216f0dd3e55326af74883fa23c9acd0a8e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=13146e216f0dd3e55326af74883fa23c9acd0a8e

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Apr 27 20:21:39 2011 +0200

wined3d: Merge the IWineD3DSurface::PreLoad() implementations.

---

 dlls/wined3d/surface.c         |   41 ++++++++++++++++++++++++++-------------
 dlls/wined3d/wined3d_private.h |    1 +
 2 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 09c07fc..34be870 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -755,6 +755,13 @@ static HRESULT surface_draw_overlay(IWineD3DSurfaceImpl *surface)
     return hr;
 }
 
+static void surface_preload(IWineD3DSurfaceImpl *surface)
+{
+    TRACE("surface %p.\n", surface);
+
+    surface_internal_preload(surface, SRGB_ANY);
+}
+
 static void surface_map(IWineD3DSurfaceImpl *surface, const RECT *rect, DWORD flags)
 {
     IWineD3DDeviceImpl *device = surface->resource.device;
@@ -1036,6 +1043,7 @@ static const struct wined3d_surface_ops surface_ops =
     surface_cleanup,
     surface_realize_palette,
     surface_draw_overlay,
+    surface_preload,
     surface_map,
     surface_unmap,
 };
@@ -1153,6 +1161,13 @@ static HRESULT gdi_surface_draw_overlay(IWineD3DSurfaceImpl *surface)
     return E_FAIL;
 }
 
+static void gdi_surface_preload(IWineD3DSurfaceImpl *surface)
+{
+    TRACE("surface %p.\n", surface);
+
+    ERR("Preloading GDI surfaces is not supported.\n");
+}
+
 static void gdi_surface_map(IWineD3DSurfaceImpl *surface, const RECT *rect, DWORD flags)
 {
     TRACE("surface %p, rect %s, flags %#x.\n",
@@ -1190,6 +1205,7 @@ static const struct wined3d_surface_ops gdi_surface_ops =
     surface_gdi_cleanup,
     gdi_surface_realize_palette,
     gdi_surface_draw_overlay,
+    gdi_surface_preload,
     gdi_surface_map,
     gdi_surface_unmap,
 };
@@ -2097,6 +2113,15 @@ static DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface)
     return resource_get_priority(&((IWineD3DSurfaceImpl *)iface)->resource);
 }
 
+static void WINAPI IWineD3DBaseSurfaceImpl_PreLoad(IWineD3DSurface *iface)
+{
+    IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)iface;
+
+    TRACE("iface %p.\n", iface);
+
+    surface->surface_ops->surface_preload(surface);
+}
+
 static void * WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface)
 {
     TRACE("iface %p.\n", iface);
@@ -3848,11 +3873,6 @@ void surface_internal_preload(IWineD3DSurfaceImpl *surface, enum WINED3DSRGB srg
     }
 }
 
-static void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface)
-{
-    surface_internal_preload((IWineD3DSurfaceImpl *)iface, SRGB_ANY);
-}
-
 BOOL surface_init_sysmem(IWineD3DSurfaceImpl *surface)
 {
     if (!surface->resource.allocatedMemory)
@@ -6969,7 +6989,7 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
     IWineD3DBaseSurfaceImpl_FreePrivateData,
     IWineD3DBaseSurfaceImpl_SetPriority,
     IWineD3DBaseSurfaceImpl_GetPriority,
-    IWineD3DSurfaceImpl_PreLoad,
+    IWineD3DBaseSurfaceImpl_PreLoad,
     /* IWineD3DSurface */
     IWineD3DBaseSurfaceImpl_GetResource,
     IWineD3DBaseSurfaceImpl_Map,
@@ -7243,13 +7263,6 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined
     return TRUE;
 }
 
-static void WINAPI IWineGDISurfaceImpl_PreLoad(IWineD3DSurface *iface)
-{
-    ERR("(%p): PreLoad is not supported on X11 surfaces!\n", iface);
-    ERR("(%p): Most likely the parent library did something wrong.\n", iface);
-    ERR("(%p): Please report to wine-devel\n", iface);
-}
-
 /*****************************************************************************
  * IWineD3DSurface::Flip, GDI version
  *
@@ -7455,7 +7468,7 @@ static const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
     IWineD3DBaseSurfaceImpl_FreePrivateData,
     IWineD3DBaseSurfaceImpl_SetPriority,
     IWineD3DBaseSurfaceImpl_GetPriority,
-    IWineGDISurfaceImpl_PreLoad,
+    IWineD3DBaseSurfaceImpl_PreLoad,
     /* IWineD3DSurface */
     IWineD3DBaseSurfaceImpl_GetResource,
     IWineD3DBaseSurfaceImpl_Map,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 45fcd91..e8208bd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2024,6 +2024,7 @@ struct wined3d_surface_ops
     void (*surface_cleanup)(struct IWineD3DSurfaceImpl *surface);
     void (*surface_realize_palette)(struct IWineD3DSurfaceImpl *surface);
     HRESULT (*surface_draw_overlay)(struct IWineD3DSurfaceImpl *surface);
+    void (*surface_preload)(struct IWineD3DSurfaceImpl *surface);
     void (*surface_map)(struct IWineD3DSurfaceImpl *surface, const RECT *rect, DWORD flags);
     void (*surface_unmap)(struct IWineD3DSurfaceImpl *surface);
 };




More information about the wine-cvs mailing list