[gtk+] pixelcache: Add map/unmap functions



commit 2587d4b8e6542ec578632c311309a3f4d13f0b3e
Author: Benjamin Otte <otte redhat com>
Date:   Wed Apr 9 23:31:21 2014 +0200

    pixelcache: Add map/unmap functions
    
    Because GTK does not invalidate windows that aren't mapped, we cannot
    update the pixel cache when the window it handles isn't mapped. So we
    add API to call when GDK windows get mapped/unmapped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726475

 gtk/gtkpixelcache.c        |   12 ++++++++++++
 gtk/gtkpixelcacheprivate.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c
index 2a90964..339518b 100644
--- a/gtk/gtkpixelcache.c
+++ b/gtk/gtkpixelcache.c
@@ -467,3 +467,15 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache,
       draw (cr, user_data);
     }
 }
+
+void
+_gtk_pixel_cache_map (GtkPixelCache *cache)
+{
+  _gtk_pixel_cache_invalidate (cache, NULL);
+}
+
+void
+_gtk_pixel_cache_unmap (GtkPixelCache *cache)
+{
+  gtk_pixel_cache_blow_cache (cache);
+}
diff --git a/gtk/gtkpixelcacheprivate.h b/gtk/gtkpixelcacheprivate.h
index 69635b7..c31693e 100644
--- a/gtk/gtkpixelcacheprivate.h
+++ b/gtk/gtkpixelcacheprivate.h
@@ -32,6 +32,8 @@ typedef void (*GtkPixelCacheDrawFunc) (cairo_t *cr,
 
 GtkPixelCache *_gtk_pixel_cache_new            (void);
 void           _gtk_pixel_cache_free           (GtkPixelCache         *cache);
+void           _gtk_pixel_cache_map            (GtkPixelCache         *cache);
+void           _gtk_pixel_cache_unmap          (GtkPixelCache         *cache);
 void           _gtk_pixel_cache_invalidate     (GtkPixelCache         *cache,
                                                 cairo_region_t        *region);
 void           _gtk_pixel_cache_draw           (GtkPixelCache         *cache,


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