Henri Verbeet : wined3d: Get rid of the now redundant SFLAG_SWAPCHAIN surface flag.

Alexandre Julliard julliard at winehq.org
Tue Aug 17 11:31:10 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Aug 16 20:00:26 2010 +0200

wined3d: Get rid of the now redundant SFLAG_SWAPCHAIN surface flag.

---

 dlls/wined3d/device.c          |   10 ----------
 dlls/wined3d/surface.c         |    5 +++--
 dlls/wined3d/swapchain.c       |    2 --
 dlls/wined3d/wined3d_private.h |    1 -
 4 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 057c107..d615004 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5650,17 +5650,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
         TRACE("Changing the front buffer from %p to %p.\n", swapchain->front_buffer, front_impl);
 
         if (swapchain->front_buffer)
-        {
             surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL);
-            swapchain->front_buffer->Flags &= ~SFLAG_SWAPCHAIN;
-        }
         swapchain->front_buffer = front_impl;
 
         if (front_impl)
-        {
             surface_set_container(front_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
-            front_impl->Flags |= SFLAG_SWAPCHAIN;
-        }
     }
 
     if (swapchain->back_buffers[0] != back_impl)
@@ -5668,10 +5662,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
         TRACE("Changing the back buffer from %p to %p.\n", swapchain->back_buffers[0], back_impl);
 
         if (swapchain->back_buffers[0])
-        {
             surface_set_container(swapchain->back_buffers[0], WINED3D_CONTAINER_TEXTURE, NULL);
-            swapchain->back_buffers[0]->Flags &= ~SFLAG_SWAPCHAIN;
-        }
         swapchain->back_buffers[0] = back_impl;
 
         if (back_impl)
@@ -5682,7 +5673,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
             swapchain->presentParms.BackBufferCount = 1;
 
             surface_set_container(back_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
-            back_impl->Flags |= SFLAG_SWAPCHAIN;
         }
         else
         {
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index f9771ba..d264e18 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1700,7 +1700,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
     }
 
     if (!(wined3d_settings.rendertargetlock_mode == RTL_DISABLE
-            && ((This->Flags & SFLAG_SWAPCHAIN) || This == device->render_targets[0])))
+            && ((This->container.type == WINED3D_CONTAINER_SWAPCHAIN) || This == device->render_targets[0])))
     {
         surface_load_location(This, SFLAG_INSYSMEM, pass_rect);
     }
@@ -1892,7 +1892,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
         goto unlock_end;
     }
 
-    if ((This->Flags & SFLAG_SWAPCHAIN) || (device->render_targets && This == device->render_targets[0]))
+    if (This->container.type == WINED3D_CONTAINER_SWAPCHAIN
+            || (device->render_targets && This == device->render_targets[0]))
     {
         if(wined3d_settings.rendertargetlock_mode == RTL_DISABLE) {
             static BOOL warned = FALSE;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index ea38bf1..c376cbf 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -732,7 +732,6 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
     }
 
     surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
-    swapchain->front_buffer->Flags |= SFLAG_SWAPCHAIN;
     if (surface_type == SURFACE_OPENGL)
     {
         surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE);
@@ -848,7 +847,6 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
             }
 
             surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
-            swapchain->back_buffers[i]->Flags |= SFLAG_SWAPCHAIN;
         }
     }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 384af7d..b99dc8c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2185,7 +2185,6 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) DECLSPE
 #define SFLAG_DS_ONSCREEN   0x00200000 /* Is a depth stencil, last modified onscreen */
 #define SFLAG_DS_OFFSCREEN  0x00400000 /* Is a depth stencil, last modified offscreen */
 #define SFLAG_INOVERLAYDRAW 0x00800000 /* Overlay drawing is in progress. Recursion prevention */
-#define SFLAG_SWAPCHAIN     0x01000000 /* The surface is part of a swapchain */
 
 /* In some conditions the surface memory must not be freed:
  * SFLAG_CONVERTED: Converting the data back would take too long




More information about the wine-cvs mailing list