Commit 8292c687 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 0b24db5d
......@@ -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
{
......
......@@ -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;
......
......@@ -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;
}
}
......
......@@ -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
......
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