[gtk+] examples: Port example to use cairo region API
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] examples: Port example to use cairo region API
- Date: Tue, 29 Jun 2010 15:06:57 +0000 (UTC)
commit 6c5dffd1a39133753b865880f1674e6b82d480d2
Author: Benjamin Otte <otte redhat com>
Date: Mon Jun 28 16:19:30 2010 +0200
examples: Port example to use cairo region API
https://bugzilla.gnome.org/show_bug.cgi?id=613284
examples/gdk/composited-window-example.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/examples/gdk/composited-window-example.c b/examples/gdk/composited-window-example.c
index b28f712..dbb49ec 100644
--- a/examples/gdk/composited-window-example.c
+++ b/examples/gdk/composited-window-example.c
@@ -45,7 +45,7 @@ static gboolean
window_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
- GdkRegion *region;
+ cairo_region_t *region;
GtkWidget *child;
cairo_t *cr;
@@ -61,10 +61,11 @@ window_expose_event (GtkWidget *widget,
child->allocation.y);
/* draw no more than our expose event intersects our child */
- region = gdk_region_rectangle (&child->allocation);
- gdk_region_intersect (region, event->region);
+ region = cairo_region_create_rectangle (&child->allocation);
+ cairo_region_intersect (region, region, event->region);
gdk_cairo_region (cr, region);
cairo_clip (cr);
+ cairo_region_destroy (region);
/* composite, with a 50% opacity */
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]