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
This commit is contained in:
Benjamin Otte
2014-04-09 23:31:21 +02:00
parent 651f1c566a
commit 23dfc25583
2 changed files with 14 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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,