[gtk+] Pixel cache: Add no-pixel-cache debug flag



commit 92edb7650086e1ec55b804a7d8032f220c740757
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Sep 9 11:07:50 2013 +0200

    Pixel cache: Add no-pixel-cache debug flag
    
    This is useful for benchmarking comparisons, and to verify if bugs
    happend with or without the pixel cache.

 gtk/gtkdebug.h      |    3 ++-
 gtk/gtkmain.c       |    3 ++-
 gtk/gtkpixelcache.c |    5 +++++
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h
index d98c197..a91e6da 100644
--- a/gtk/gtkdebug.h
+++ b/gtk/gtkdebug.h
@@ -50,7 +50,8 @@ typedef enum {
   GTK_DEBUG_SIZE_REQUEST    = 1 << 12,
   GTK_DEBUG_NO_CSS_CACHE    = 1 << 13,
   GTK_DEBUG_BASELINES       = 1 << 14,
-  GTK_DEBUG_PIXEL_CACHE     = 1 << 15
+  GTK_DEBUG_PIXEL_CACHE     = 1 << 15,
+  GTK_DEBUG_NO_PIXEL_CACHE  = 1 << 16
 } GtkDebugFlag;
 
 #ifdef G_ENABLE_DEBUG
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 4d814a9..285d181 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -173,7 +173,8 @@ static const GDebugKey gtk_debug_keys[] = {
   {"size-request", GTK_DEBUG_SIZE_REQUEST},
   {"no-css-cache", GTK_DEBUG_NO_CSS_CACHE},
   {"baselines", GTK_DEBUG_BASELINES},
-  {"pixel-cache", GTK_DEBUG_PIXEL_CACHE}
+  {"pixel-cache", GTK_DEBUG_PIXEL_CACHE},
+  {"no-pixel-cache", GTK_DEBUG_NO_PIXEL_CACHE}
 };
 #endif /* G_ENABLE_DEBUG */
 
diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c
index 2529f11..ca6740f 100644
--- a/gtk/gtkpixelcache.c
+++ b/gtk/gtkpixelcache.c
@@ -174,6 +174,11 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache         *cache,
   cairo_pattern_t *bg;
   double red, green, blue, alpha;
 
+#ifdef G_ENABLE_DEBUG
+  if (gtk_get_debug_flags () & GTK_DEBUG_NO_PIXEL_CACHE)
+    return;
+#endif
+
   content = cache->content;
   if (!content)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]