[cairo-commit] cairo/src cairo.c, 1.128, 1.129 cairoint.h, 1.201, 1.202

Billy Biggs commit at pdx.freedesktop.org
Mon Aug 22 14:04:54 EST 2005


Committed by: vektor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv8309/src

Modified Files:
	cairo.c cairoint.h 
Log Message:
	* src/cairo.c: (cairo_paint_with_alpha): Optimize away calls to
	cairo_paint_with_alpha() if the alpha value given is <= 0.

	* src/cairoint.h: Add a new macro CAIRO_ALPHA_IS_ZERO.



Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- cairo.c	19 Aug 2005 19:08:42 -0000	1.128
+++ cairo.c	22 Aug 2005 04:04:52 -0000	1.129
@@ -1302,6 +1302,10 @@
 	return;
     }
 
+    if (CAIRO_ALPHA_IS_ZERO (alpha)) {
+	return;
+    }
+
     _cairo_color_init_rgba (&color, 1., 1., 1., alpha);
     _cairo_pattern_init_solid (&pattern.solid, &color);
 

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- cairoint.h	21 Aug 2005 15:53:56 -0000	1.201
+++ cairoint.h	22 Aug 2005 04:04:52 -0000	1.202
@@ -178,6 +178,7 @@
 #define CAIRO_MINSHORT SHRT_MIN
 
 #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
+#define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0)
 
 #include "cairo-hash-private.h"
 



More information about the cairo-commit mailing list