summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lindgren <john.lindgren@aol.com>2014-12-03 10:33:00 (GMT)
committerAlexander Larsson <alexl@redhat.com>2014-12-05 10:05:48 (GMT)
commitad6271eca90e6139acd624209e10931d0dffbd73 (patch)
tree7dbd2ce986950c83b52aa3b8beb271831a206467
parent5bafcca63f8d065461c311f1ab768e7d0d290813 (diff)
downloadgtk+-ad6271eca90e6139acd624209e10931d0dffbd73.zip
gtk+-ad6271eca90e6139acd624209e10931d0dffbd73.tar.xz
gdk_window_begin_paint_region() - always reuse the same surface
When using the implicit paint pixmap, always draw to the same surface (the standard one for the pixmap) each time rather than creating a new one each time. This is both more effective and more natural. It also fixes a redraw issue on win32, where using multiple surfaces on the same HDC sometimes causes issues. This seems to be due to leftover state on the HDC from previous surfaces. https://bugzilla.gnome.org/show_bug.cgi?id=741060
-rw-r--r--gdk/gdkwindow.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 386e85d..45fee34 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2984,15 +2984,10 @@ gdk_window_begin_paint_region (GdkWindow *window,
if (implicit_paint)
{
- int width, height;
-
paint->uses_implicit = TRUE;
paint->pixmap = g_object_ref (implicit_paint->pixmap);
paint->x_offset = -private->abs_x + implicit_paint->x_offset;
paint->y_offset = -private->abs_y + implicit_paint->y_offset;
-
- gdk_drawable_get_size (paint->pixmap, &width, &height);
- paint->surface = _gdk_drawable_create_cairo_surface (paint->pixmap, width, height);
}
else
{
@@ -3002,9 +2997,10 @@ gdk_window_begin_paint_region (GdkWindow *window,
paint->pixmap =
gdk_pixmap_new (window,
MAX (clip_box.width, 1), MAX (clip_box.height, 1), -1);
- paint->surface = _gdk_drawable_ref_cairo_surface (paint->pixmap);
}
+ paint->surface = _gdk_drawable_ref_cairo_surface (paint->pixmap);
+
if (paint->surface)
cairo_surface_set_device_offset (paint->surface,
-paint->x_offset, -paint->y_offset);