[cairo-commit] rcairo/src rb_cairo_surface.c,1.35,1.36

Kouhei Sutou commit at pdx.freedesktop.org
Thu Jun 19 19:01:55 PDT 2008


Committed by: kou

Update of /cvs/cairo/rcairo/src
In directory kemper:/tmp/cvs-serv6460/src

Modified Files:
	rb_cairo_surface.c 
Log Message:
* src/rb_cairo_surface.c (yield_and_finish): don't finish if it isn't needed.


Index: rb_cairo_surface.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_surface.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- rb_cairo_surface.c	20 Jun 2008 01:56:47 -0000	1.35
+++ rb_cairo_surface.c	20 Jun 2008 02:01:53 -0000	1.36
@@ -66,6 +66,7 @@
 static ID cr_id_dup;
 static cairo_user_data_key_t cr_closure_key;
 static cairo_user_data_key_t cr_object_holder_key;
+static cairo_user_data_key_t cr_finished_key;
 
 #define _SELF  (RVAL2CRSURFACE(self))
 
@@ -388,6 +389,7 @@
   closure = cairo_surface_get_user_data (surface, &cr_closure_key);
 
   cairo_surface_finish (surface);
+  cairo_surface_set_user_data (surface, &cr_finished_key, (void *)CR_TRUE, NULL);
   cairo_surface_set_user_data (surface, &cr_object_holder_key, NULL, NULL);
 
   if (closure && !NIL_P (closure->error))
@@ -400,8 +402,13 @@
 static void
 yield_and_finish (VALUE self)
 {
+  cairo_surface_t *surface;
+
   rb_yield (self);
-  cr_surface_finish (self);
+
+  surface = _SELF;
+  if (!cairo_surface_get_user_data (surface, &cr_finished_key))
+    cr_surface_finish (self);
 }
 
 static VALUE



More information about the cairo-commit mailing list