[libgxps] Don't check alpha value before creating solid color patterns



commit 92341b3a54916bff61a134782e9837a1e0956a9d
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Nov 6 13:40:41 2011 +0100

    Don't check alpha value before creating solid color patterns
    
    cairo_pattern_create_rgb() calls cairo_pattern_create_rgba() with
    apha = 1, so we can always use cairo_pattern_create_rgba().

 libgxps/gxps-page.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/libgxps/gxps-page.c b/libgxps/gxps-page.c
index e5f030b..abb0891 100644
--- a/libgxps/gxps-page.c
+++ b/libgxps/gxps-page.c
@@ -890,10 +890,7 @@ gxps_create_solid_color_pattern (const gchar *color)
 	if (!gxps_color_parse (color, &a, &r, &g, &b))
 		return NULL;
 
-	pattern = (a != 1.0) ?
-		cairo_pattern_create_rgba (r, g, b, a) :
-		cairo_pattern_create_rgb (r, g, b);
-
+	pattern = cairo_pattern_create_rgba (r, g, b, a);
 	if (cairo_pattern_status (pattern)) {
 		cairo_pattern_destroy (pattern);
 		return NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]