Roderick Colenbrander : wined3d: Let flush_to_framebuffer_drawpixels use a valid rect.

Alexandre Julliard julliard at winehq.org
Wed Feb 20 06:46:39 CST 2008


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

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Tue Feb 19 21:18:26 2008 +0100

wined3d: Let flush_to_framebuffer_drawpixels use a valid rect.

---

 dlls/wined3d/surface.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index ca3dea4..f1217d9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1163,11 +1163,19 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
         checkGLcall("glBindBufferARB");
     }
 
-    glDrawPixels(This->lockedRect.right - This->lockedRect.left,
-                 (This->lockedRect.bottom - This->lockedRect.top)-1,
-                 fmt, type,
-                 mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
-    checkGLcall("glDrawPixels");
+    /* When the surface is locked we only have to refresh the locked part else we need to update the whole image */
+    if(This->Flags & SFLAG_LOCKED) {
+        glDrawPixels(This->lockedRect.right - This->lockedRect.left,
+                     (This->lockedRect.bottom - This->lockedRect.top)-1,
+                     fmt, type,
+                     mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
+        checkGLcall("glDrawPixels");
+    } else {
+        glDrawPixels(This->currentDesc.Width,
+                     This->currentDesc.Height,
+                     fmt, type, mem);
+        checkGLcall("glDrawPixels");
+    }
 
     if(This->Flags & SFLAG_PBO) {
         GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));




More information about the wine-cvs mailing list