[PATCH 2/5] wined3d: Use surface_is_offscreen() in read_from_framebuffer_texture().
Henri Verbeet
hverbeet at codeweavers.com
Tue Dec 15 10:51:34 CST 2009
---
dlls/wined3d/surface.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5a0da0e..00051ed 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1172,7 +1172,6 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
{
IWineD3DDeviceImpl *device = This->resource.device;
- IWineD3DSwapChainImpl *swapchain;
struct wined3d_context *context;
int bpp;
GLenum format, internal, type;
@@ -1197,18 +1196,18 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
* There is no need to keep track of the current read buffer or reset it, every part of the code
* that reads sets the read buffer as desired.
*/
- 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);
+ GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *)This, (IWineD3DSwapChain *)This->container);
TRACE("Locking %#x buffer\n", buffer);
ENTER_GL();
glReadBuffer(buffer);
checkGLcall("glReadBuffer");
LEAVE_GL();
-
- IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
- } else {
+ }
+ else
+ {
/* Locking the primary render target which is not on a swapchain(=offscreen render target).
* Read from the back buffer
*/
--
1.6.4.4
More information about the wine-patches
mailing list