Commit 97f04248 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use surface_is_offscreen() in flush_to_framebuffer_drawpixels().

parent bf113bd2
...@@ -1425,16 +1425,15 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm ...@@ -1425,16 +1425,15 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
GLint skipBytes = 0; GLint skipBytes = 0;
UINT pitch = IWineD3DSurface_GetPitch((IWineD3DSurface *) This); /* target is argb, 4 byte */ UINT pitch = IWineD3DSurface_GetPitch((IWineD3DSurface *) This); /* target is argb, 4 byte */
IWineD3DDeviceImpl *myDevice = This->resource.device; IWineD3DDeviceImpl *myDevice = This->resource.device;
IWineD3DSwapChainImpl *swapchain;
struct wined3d_context *context; struct wined3d_context *context;
/* Activate the correct context for the render target */ /* Activate the correct context for the render target */
context = context_acquire(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT); context = context_acquire(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT);
ENTER_GL(); ENTER_GL();
if (SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface *)This, &IID_IWineD3DSwapChain, (void **)&swapchain))) { if (!surface_is_offscreen((IWineD3DSurface *)This))
GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *) This, (IWineD3DSwapChain *)swapchain); {
IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain); GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *)This, (IWineD3DSwapChain *)This->container);
TRACE("Unlocking %#x buffer.\n", buffer); TRACE("Unlocking %#x buffer.\n", buffer);
context_set_draw_buffer(context, buffer); context_set_draw_buffer(context, buffer);
} }
......
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