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

This commit is contained in:
Henri Verbeet 2010-08-16 20:00:26 +02:00 committed by Alexandre Julliard
parent 0b24db5db5
commit 8292c687d8
4 changed files with 3 additions and 15 deletions

View File

@ -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); TRACE("Changing the front buffer from %p to %p.\n", swapchain->front_buffer, front_impl);
if (swapchain->front_buffer) if (swapchain->front_buffer)
{
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL); surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL);
swapchain->front_buffer->Flags &= ~SFLAG_SWAPCHAIN;
}
swapchain->front_buffer = front_impl; swapchain->front_buffer = front_impl;
if (front_impl) if (front_impl)
{
surface_set_container(front_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain); surface_set_container(front_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
front_impl->Flags |= SFLAG_SWAPCHAIN;
}
} }
if (swapchain->back_buffers[0] != back_impl) 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); TRACE("Changing the back buffer from %p to %p.\n", swapchain->back_buffers[0], back_impl);
if (swapchain->back_buffers[0]) if (swapchain->back_buffers[0])
{
surface_set_container(swapchain->back_buffers[0], WINED3D_CONTAINER_TEXTURE, NULL); surface_set_container(swapchain->back_buffers[0], WINED3D_CONTAINER_TEXTURE, NULL);
swapchain->back_buffers[0]->Flags &= ~SFLAG_SWAPCHAIN;
}
swapchain->back_buffers[0] = back_impl; swapchain->back_buffers[0] = back_impl;
if (back_impl) if (back_impl)
@ -5682,7 +5673,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
swapchain->presentParms.BackBufferCount = 1; swapchain->presentParms.BackBufferCount = 1;
surface_set_container(back_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain); surface_set_container(back_impl, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
back_impl->Flags |= SFLAG_SWAPCHAIN;
} }
else else
{ {

View File

@ -1700,7 +1700,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
} }
if (!(wined3d_settings.rendertargetlock_mode == RTL_DISABLE 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); surface_load_location(This, SFLAG_INSYSMEM, pass_rect);
} }
@ -1892,7 +1892,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
goto unlock_end; 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) { if(wined3d_settings.rendertargetlock_mode == RTL_DISABLE) {
static BOOL warned = FALSE; static BOOL warned = FALSE;

View File

@ -732,7 +732,6 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
} }
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain); surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
swapchain->front_buffer->Flags |= SFLAG_SWAPCHAIN;
if (surface_type == SURFACE_OPENGL) if (surface_type == SURFACE_OPENGL)
{ {
surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE); 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); surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain);
swapchain->back_buffers[i]->Flags |= SFLAG_SWAPCHAIN;
} }
} }

View File

@ -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_ONSCREEN 0x00200000 /* Is a depth stencil, last modified onscreen */
#define SFLAG_DS_OFFSCREEN 0x00400000 /* Is a depth stencil, last modified offscreen */ #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_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: /* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long * SFLAG_CONVERTED: Converting the data back would take too long