[maemo-commits] [maemo-commits] r19236 - in projects/haf/branches/sapwood/rgb-only: . engine

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Aug 28 15:52:49 EEST 2009
Author: herzi
Date: 2009-08-28 15:52:41 +0300 (Fri, 28 Aug 2009)
New Revision: 19236

Modified:
   projects/haf/branches/sapwood/rgb-only/ChangeLog
   projects/haf/branches/sapwood/rgb-only/engine/sapwood-main.c
   projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.c
   projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.h
   projects/haf/branches/sapwood/rgb-only/engine/theme-pixbuf.c
Log:
2009-08-07 Alejandro G. Castro <alex at igalia.com>

	Added a new debug enviroment option to enable the synchronous X
	error handling.

	* engine/sapwood-main.c,
	(theme_init): Captured the new "xtraps" option in a new boolean
	variable.
	* engine/sapwood-pixmap.h:
	* engine/sapwood-pixmap.c,
	(sapwood_pixmap_get_for_file):
	* engine/theme-pixbuf.c,
	(theme_pixbuf_render): Added conditions to avoid gdk_flush if the
	xtraps debug option is not actived.

	Fixes: NB#131431 (gdk_flush in sapwood is causing tearing)


Modified: projects/haf/branches/sapwood/rgb-only/ChangeLog
===================================================================
--- projects/haf/branches/sapwood/rgb-only/ChangeLog	2009-08-28 12:52:41 UTC (rev 19235)
+++ projects/haf/branches/sapwood/rgb-only/ChangeLog	2009-08-28 12:52:41 UTC (rev 19236)
@@ -1,3 +1,20 @@
+2009-08-07  Alejandro G. Castro  <alex at igalia.com>
+
+	Added a new debug enviroment option to enable the synchronous X
+	error handling.
+
+	* engine/sapwood-main.c,
+	(theme_init): Captured the new "xtraps" option in a new boolean
+	variable.
+	* engine/sapwood-pixmap.h:
+	* engine/sapwood-pixmap.c,
+	(sapwood_pixmap_get_for_file):
+	* engine/theme-pixbuf.c,
+	(theme_pixbuf_render): Added conditions to avoid gdk_flush if the
+	xtraps debug option is not actived.
+
+	Fixes: NB#131431 (gdk_flush in sapwood is causing tearing)
+
 2009-01-16  Sven Herzberg  <sven at imendio.com>
 
 	Don't echo the screen name; this reduces the noise from running the

Modified: projects/haf/branches/sapwood/rgb-only/engine/sapwood-main.c
===================================================================
--- projects/haf/branches/sapwood/rgb-only/engine/sapwood-main.c	2009-08-28 12:52:41 UTC (rev 19235)
+++ projects/haf/branches/sapwood/rgb-only/engine/sapwood-main.c	2009-08-28 12:52:41 UTC (rev 19236)
@@ -28,13 +28,21 @@
 #include "sapwood-rc-style.h"
 #include <gmodule.h>
 
+guint sapwood_debug_flags = 0;
 gboolean sapwood_debug_scaling = FALSE;
+gboolean sapwood_debug_xtraps = FALSE;
 
+typedef enum {
+  SAPWOOD_DEBUG_SCALING   = 1 << 0,
+  SAPWOOD_DEBUG_XTRAPS    = 1 << 1
+} SapwoodDebugFlag;
+
 G_MODULE_EXPORT void
 theme_init (GTypeModule *module)
 {
   GDebugKey keys[] = {
-    {"scaling", TRUE}
+    {"scaling", SAPWOOD_DEBUG_SCALING},
+    {"xtraps", SAPWOOD_DEBUG_XTRAPS}
   };
   const gchar* debug;
 
@@ -43,7 +51,11 @@
 
   debug = g_getenv ("SAPWOOD_DEBUG");
   if (debug)
-    sapwood_debug_scaling = g_parse_debug_string (debug, keys, G_N_ELEMENTS (keys));
+    {
+      sapwood_debug_flags = g_parse_debug_string (debug, keys, G_N_ELEMENTS (keys));
+      sapwood_debug_scaling = sapwood_debug_flags & SAPWOOD_DEBUG_SCALING;
+      sapwood_debug_xtraps = sapwood_debug_flags & SAPWOOD_DEBUG_XTRAPS;
+    }
 }
 
 G_MODULE_EXPORT void

Modified: projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.c
===================================================================
--- projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.c	2009-08-28 12:52:41 UTC (rev 19235)
+++ projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.c	2009-08-28 12:52:41 UTC (rev 19236)
@@ -134,7 +134,10 @@
 	  {
 	    gdk_error_trap_push ();
 	    pixmap = gdk_pixmap_foreign_new (rep.pixmap[i][j]);
-	    gdk_flush ();
+
+            if (sapwood_debug_xtraps)
+              gdk_flush ();
+
 	    if ((xerror = gdk_error_trap_pop ()) || !pixmap)
 	      {
 		g_warning ("%s: pixmap[%d][%d]: gdk_pixmap_foreign_new(%x) failed, X error = %d",
@@ -149,7 +152,10 @@
 	  {
 	    gdk_error_trap_push ();
 	    pixmask = gdk_pixmap_foreign_new (rep.pixmask[i][j]);
-	    gdk_flush ();
+
+            if (sapwood_debug_xtraps)
+              gdk_flush ();
+
 	    if ((xerror = gdk_error_trap_pop ()) || !pixmask)
 	      {
 		g_warning ("%s: pixmask[%d][%d]: gdk_pixmap_foreign_new(%x) failed, X error = %d", 

Modified: projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.h
===================================================================
--- projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.h	2009-08-28 12:52:41 UTC (rev 19235)
+++ projects/haf/branches/sapwood/rgb-only/engine/sapwood-pixmap.h	2009-08-28 12:52:41 UTC (rev 19236)
@@ -71,6 +71,7 @@
 				      SapwoodRect   *rects) G_GNUC_INTERNAL;
 
 G_GNUC_INTERNAL extern gboolean sapwood_debug_scaling;
+G_GNUC_INTERNAL extern gboolean sapwood_debug_xtraps;
 
 G_END_DECLS
 

Modified: projects/haf/branches/sapwood/rgb-only/engine/theme-pixbuf.c
===================================================================
--- projects/haf/branches/sapwood/rgb-only/engine/theme-pixbuf.c	2009-08-28 12:52:41 UTC (rev 19235)
+++ projects/haf/branches/sapwood/rgb-only/engine/theme-pixbuf.c	2009-08-28 12:52:41 UTC (rev 19236)
@@ -384,7 +384,9 @@
 
 	  mask = gdk_pixmap_new (NULL, mask_width, mask_height, 1);
 
-	  gdk_flush ();
+          if (sapwood_debug_xtraps)
+            gdk_flush ();
+
 	  if (gdk_error_trap_pop ())
 	    {
 	      if (clip_rect)

More information about the maemo-commits mailing list