[gtk+] Fix non-double-buffered drawing



commit 5d9736fe13fe0178c725cf7ff04ad188cd4d5d1b
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Feb 9 21:05:35 2012 +0100

    Fix non-double-buffered drawing
    
    There was a sign issue in a coordinate transform that made us
    flush the wrong region when flushing an implicit paint.
    The non-double buffered drawing would then be drawn over the
    right area, but then at the end of the implicit paint this
    would be overdrawn with the area we didn't properly remove
    from the implicit paint.
    
    Also, the translation from window coords to impl window
    coords is now done before removing any active double
    buffered paints, as these are also in impl window coords.

 gdk/gdkwindow.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1a64f43..1642424 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2765,6 +2765,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
   paint->flushed = TRUE;
   region = cairo_region_copy (window->clip_region_with_children);
 
+  cairo_region_translate (region, window->abs_x, window->abs_y);
+  cairo_region_intersect (region, paint->region);
+
   /* Don't flush active double buffers, as that may show partially done
    * rendering */
   for (list = window->paint_stack; list != NULL; list = list->next)
@@ -2774,9 +2777,6 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
       cairo_region_subtract (region, tmp_paint->region);
     }
 
-  cairo_region_translate (region, -window->abs_x, -window->abs_y);
-  cairo_region_intersect (region, paint->region);
-
   if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (region))
     {
       cairo_t *cr;



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