Resend: Change copy mode, when render OpenGL picture

Ivan Sinitsin ivan at etersoft.ru
Fri Oct 10 03:53:13 CDT 2008


 0001-change-render-mode-when-copy-opengl-picture-to-window.txt
   
When we mix opengl and GDI output, and use SetROP2 function, we may get such 
pictures (http://bugs.winehq.org/show_bug.cgi?id=11012). This patch fix that 
bug. We always must copy OpenGL picture with mode GXcopy


changelog
        This patch change copy mode, when copy OpenGL picture to window. Fix 
#11012 
bug. 

-- 
Ivan Sinitsin
-------------- next part --------------
From abba29e01abf4a4680f34a65997c7430caaaed62 Mon Sep 17 00:00:00 2001
From: Ivan Sinitsin <ivan at etersoft.ru>
Date: Tue, 30 Sep 2008 11:02:54 +0400
Subject: [PATCH] change render mode, when copy opengl picture to window. Fix bug #11012 (bugs.winehq.org)

---
 dlls/winex11.drv/opengl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 3f6d131..5cf7cd0 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -2091,6 +2091,7 @@ static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params)
 void flush_gl_drawable(X11DRV_PDEVICE *physDev)
 {
     int w, h;
+    XGCValues gcvalues;
 
     if (!physDev->gl_copy)
         return;
@@ -2106,8 +2107,13 @@ void flush_gl_drawable(X11DRV_PDEVICE *physDev)
          * flush the display make sure we copy up-to-date data */
         wine_tsx11_lock();
         XFlush(gdi_display);
+        /*Render GL always in GXcopy mode*/
+        XGetGCValues(gdi_display, physDev->gc, GCFunction, &gcvalues);
+        XSetFunction(gdi_display, physDev->gc, GXcopy);
         XCopyArea(gdi_display, src, physDev->drawable, physDev->gc, 0, 0, w, h,
                   physDev->dc_rect.left, physDev->dc_rect.top);
+        /*return old mode*/
+        XSetFunction(gdi_display, physDev->gc, gcvalues.function);
         wine_tsx11_unlock();
     }
 }
-- 
1.5.6.5.GIT



More information about the wine-patches mailing list