]> Pileus Git - ~andy/gtk/commitdiff
gdkwindow: Store the implicit paint in a list
authorAlexander Larsson <alexl@redhat.com>
Wed, 7 Nov 2012 12:01:09 +0000 (13:01 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 7 Feb 2013 10:11:37 +0000 (11:11 +0100)
This changes nothing, but lets us later have multiple
implicit paints

https://bugzilla.gnome.org/show_bug.cgi?id=687842

gdk/gdkinternals.h
gdk/gdkwindow.c

index 0eb4074cb8ce9459324567ff93df53d6e5f07b9a..4a2bc87488c1f24c6d42439c7d95514ee79dd24e 100644 (file)
@@ -247,7 +247,7 @@ struct _GdkWindow
   GdkCursor *cursor;
   GHashTable *device_cursor;
 
-  GdkWindowPaint *implicit_paint;
+  GSList *implicit_paint;
 
   GList *outstanding_moves;
 
index 1aa11f13cba079c4b31bb8d03444b2a1f0243964..99e469ffed119cbd90d4ee5fc589772a6af6b7d9 100644 (file)
@@ -2752,7 +2752,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
                                                       MAX (rect->height, 1));
   cairo_surface_set_device_offset (paint->surface, -rect->x, -rect->y);
 
-  window->implicit_paint = paint;
+  window->implicit_paint = g_slist_prepend (window->implicit_paint, paint);
 
   return TRUE;
 }
@@ -2807,7 +2807,7 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
   if (impl_window->implicit_paint == NULL)
     return;
 
-  paint = impl_window->implicit_paint;
+  paint = impl_window->implicit_paint->data;
 
   region = cairo_region_copy (window->clip_region_with_children);
   cairo_region_translate (region, window->abs_x, window->abs_y);
@@ -2838,9 +2838,10 @@ gdk_window_end_implicit_paint (GdkWindow *window)
 
   g_assert (window->implicit_paint != NULL);
 
-  paint = window->implicit_paint;
+  paint = window->implicit_paint->data;
 
-  window->implicit_paint = NULL;
+  window->implicit_paint = g_slist_delete_link (window->implicit_paint,
+                                               window->implicit_paint);
 
   if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (paint->region))
     {
@@ -2957,7 +2958,7 @@ gdk_window_begin_paint_region (GdkWindow       *window,
     }
 
   impl_window = gdk_window_get_impl_window (window);
-  implicit_paint = impl_window->implicit_paint;
+  implicit_paint = impl_window->implicit_paint != NULL ? impl_window->implicit_paint->data : NULL;
 
   paint = g_new (GdkWindowPaint, 1);
   paint->region = cairo_region_copy (region);
@@ -3325,6 +3326,8 @@ move_region_on_impl (GdkWindow *impl_window,
                     cairo_region_t *region, /* In impl window coords */
                     int dx, int dy)
 {
+  GSList *l;
+
   if ((dx == 0 && dy == 0) ||
       cairo_region_is_empty (region))
     {
@@ -3363,9 +3366,9 @@ move_region_on_impl (GdkWindow *impl_window,
   /* If we're currently exposing this window, don't copy to this
      destination, as it will be overdrawn when the expose is done,
      instead invalidate it and repaint later. */
-  if (impl_window->implicit_paint)
+  for (l = impl_window->implicit_paint; l != NULL; l = l->next)
     {
-      GdkWindowPaint *implicit_paint = impl_window->implicit_paint;
+      GdkWindowPaint *implicit_paint = l->data;
       cairo_region_t *exposing;
 
       exposing = cairo_region_copy (implicit_paint->region);
@@ -4083,7 +4086,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
               * be to late to anti-expose now. Since this is merely an
               * optimization we just avoid doing it at all in that case.
               */
-             if (window->implicit_paint != NULL && !window->implicit_paint->flushed)
+             if (window->implicit_paint != NULL && !((GdkWindowPaint *)window->implicit_paint->data)->flushed)
                 save_region = impl_class->queue_antiexpose (window, update_area);
 
              gdk_window_end_implicit_paint (window);