[gtk+] gdk: Implement end_implicit_paint() with Cairo
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Implement end_implicit_paint() with Cairo
- Date: Tue, 10 Aug 2010 19:15:44 +0000 (UTC)
commit 46206f8bb824d82d89b528bc9bd557b3bd30d5d2
Author: Benjamin Otte <otte redhat com>
Date: Mon Jul 19 13:29:47 2010 +0200
gdk: Implement end_implicit_paint() with Cairo
gdk/gdkwindow.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1d0e220..9cfea84 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2839,7 +2839,6 @@ gdk_window_end_implicit_paint (GdkWindow *window)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowPaint *paint;
- GdkGC *tmp_gc;
g_assert (gdk_window_has_impl (private));
@@ -2851,16 +2850,18 @@ gdk_window_end_implicit_paint (GdkWindow *window)
if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (paint->region))
{
+ cairo_t *cr;
+
/* Some regions are valid, push these to window now */
- tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)window, FALSE);
- _gdk_gc_set_clip_region_internal (tmp_gc, paint->region, TRUE);
- gdk_draw_drawable (private->impl, tmp_gc, paint->pixmap,
- 0, 0, paint->x_offset, paint->y_offset, -1, -1);
- /* Reset clip region of the cached GdkGC */
- gdk_gc_set_clip_region (tmp_gc, NULL);
+ cr = gdk_cairo_create (private->impl);
+ gdk_cairo_set_source_pixmap (cr, paint->pixmap,
+ paint->x_offset, paint->y_offset);
+ gdk_cairo_region (cr, paint->region);
+ cairo_fill (cr);
+ cairo_destroy (cr);
}
- else
- cairo_region_destroy (paint->region);
+
+ cairo_region_destroy (paint->region);
g_object_unref (paint->pixmap);
g_free (paint);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]