Ken Thomases : winemac: Add registry setting to control glFlush() skipping for single-buffer contexts and disable it by default.

Alexandre Julliard julliard at winehq.org
Tue Jul 2 14:31:29 CDT 2013


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

Author: Ken Thomases <ken at codeweavers.com>
Date:   Tue Jul  2 01:25:32 2013 -0500

winemac: Add registry setting to control glFlush() skipping for single-buffer contexts and disable it by default.

---

 dlls/winemac.drv/macdrv.h      |    3 +++
 dlls/winemac.drv/macdrv_main.c |    4 ++++
 dlls/winemac.drv/opengl.c      |    3 ++-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 0f39e5d..4c761af 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -35,6 +35,9 @@
 #include "wine/gdi_driver.h"
 
 
+extern BOOL skip_single_buffer_flushes DECLSPEC_HIDDEN;
+
+
 extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
 
 static inline CGRect cgrect_from_rect(RECT rect)
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c
index 470553e..29dc0b7 100644
--- a/dlls/winemac.drv/macdrv_main.c
+++ b/dlls/winemac.drv/macdrv_main.c
@@ -47,6 +47,7 @@ DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES;
 
 int topmost_float_inactive = TOPMOST_FLOAT_INACTIVE_NONFULLSCREEN;
 int capture_displays_for_fullscreen = 0;
+BOOL skip_single_buffer_flushes = FALSE;
 
 
 /**************************************************************************
@@ -156,6 +157,9 @@ static void setup_options(void)
     if (!get_config_key(hkey, appkey, "CaptureDisplaysForFullscreen", buffer, sizeof(buffer)))
         capture_displays_for_fullscreen = IS_OPTION_TRUE(buffer[0]);
 
+    if (!get_config_key(hkey, appkey, "SkipSingleBufferFlushes", buffer, sizeof(buffer)))
+        skip_single_buffer_flushes = IS_OPTION_TRUE(buffer[0]);
+
     if (appkey) RegCloseKey(appkey);
     if (hkey) RegCloseKey(hkey);
 }
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index 69f94e2..abd563a 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -3051,9 +3051,10 @@ static BOOL init_opengl(void)
 #define REDIRECT(func) \
     do { p##func = opengl_funcs.gl.p_##func; opengl_funcs.gl.p_##func = macdrv_##func; } while(0)
     REDIRECT(glCopyPixels);
-    REDIRECT(glFlush);
     REDIRECT(glReadPixels);
     REDIRECT(glViewport);
+    if (skip_single_buffer_flushes)
+        REDIRECT(glFlush);
 #undef REDIRECT
 
     /* redirect some OpenGL extension functions */




More information about the wine-cvs mailing list