[gtk+/gtk-3-14] gdk: Fix gdk_cairo_create() without begin_paint()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] gdk: Fix gdk_cairo_create() without begin_paint()
- Date: Mon, 6 Oct 2014 20:41:11 +0000 (UTC)
commit 590955dcce776249ed06625c44414101386fbe8a
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 6 22:18:20 2014 +0200
gdk: Fix gdk_cairo_create() without begin_paint()
We were translating the clip region twice in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=737825
gdk/gdkwindow.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index e023042..ae29609 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3042,7 +3042,7 @@ _gdk_window_ref_cairo_surface (GdkWindow *window)
* Creates a Cairo context for drawing to @window.
*
* Note that calling cairo_reset_clip() on the resulting #cairo_t will
- * produce undefined results, so avoid it at all costs.
+ *rproduce undefined results, so avoid it at all costs.
*
* Returns: A newly created Cairo context. Free with
* cairo_destroy() when you are done drawing.
@@ -3063,11 +3063,15 @@ gdk_cairo_create (GdkWindow *window)
cr = cairo_create (surface);
if (window->impl_window->current_paint.region != NULL)
- region = cairo_region_copy (window->impl_window->current_paint.region);
+ {
+ region = cairo_region_copy (window->impl_window->current_paint.region);
+ cairo_region_translate (region, -window->abs_x, -window->abs_y);
+ }
else
- region = cairo_region_copy (window->clip_region);
+ {
+ region = cairo_region_copy (window->clip_region);
+ }
- cairo_region_translate (region, -window->abs_x, -window->abs_y);
gdk_cairo_region (cr, region);
cairo_region_destroy (region);
cairo_clip (cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]