[cairo-commit] cairo/src cairo-gstate.c, 1.135, 1.136 cairo.c, 1.99, 1.100 cairoint.h, 1.145, 1.146

Carl Worth commit at pdx.freedesktop.org
Fri Jun 3 09:38:41 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-gstate.c cairo.c cairoint.h 
Log Message:

        * src/cairoint.h:
        * src/cairo-gstate.c:
        * src/cairo.c: (_cairo_set_source_solid), (cairo_set_source_rgb),
        (cairo_set_source_rgba): Move internal convenience up from
        _cairo_gstate_set_source_solid to _cairo_set_source_solid so that
        all set_source functions flow through cairo_set_source.


Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- cairo-gstate.c	1 Jun 2005 20:36:21 -0000	1.135
+++ cairo-gstate.c	3 Jun 2005 16:38:39 -0000	1.136
@@ -393,24 +393,6 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-cairo_status_t
-_cairo_gstate_set_source_solid (cairo_gstate_t	    *gstate,
-				const cairo_color_t *color)
-{
-    cairo_status_t status;
-    cairo_pattern_t *source;
-
-    source = _cairo_pattern_create_solid (color);
-    if (!source)
-	return CAIRO_STATUS_NO_MEMORY;
-
-    status = _cairo_gstate_set_source (gstate, source);
-
-    cairo_pattern_destroy (source);
-    
-    return CAIRO_STATUS_SUCCESS;
-}
-
 cairo_pattern_t *
 _cairo_gstate_get_source (cairo_gstate_t *gstate)
 {

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- cairo.c	31 May 2005 23:05:11 -0000	1.99
+++ cairo.c	3 Jun 2005 16:38:39 -0000	1.100
@@ -299,6 +299,22 @@
     CAIRO_CHECK_SANITY (cr);
 }
 
+static void
+_cairo_set_source_solid (cairo_t *cr, const cairo_color_t *color)
+{
+    cairo_pattern_t *source;
+
+    source = _cairo_pattern_create_solid (color);
+    if (source == NULL) {
+	cr->status = CAIRO_STATUS_NO_MEMORY;
+	return;
+    }
+
+    cairo_set_source (cr, source);
+
+    cairo_pattern_destroy (source);
+}
+
 /**
  * cairo_set_source_rgb
  * @cr: a cairo context
@@ -329,7 +345,7 @@
 
     _cairo_color_init_rgb (&color, red, green, blue);
 
-    cr->status = _cairo_gstate_set_source_solid (cr->gstate, &color);
+    _cairo_set_source_solid (cr, &color);
     
     CAIRO_CHECK_SANITY (cr);
 }
@@ -368,7 +384,7 @@
 
     _cairo_color_init_rgba (&color, red, green, blue, alpha);
 
-    cr->status = _cairo_gstate_set_source_solid (cr->gstate, &color);
+    _cairo_set_source_solid (cr, &color);
     
     CAIRO_CHECK_SANITY (cr);
 }

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- cairoint.h	1 Jun 2005 20:24:10 -0000	1.145
+++ cairoint.h	3 Jun 2005 16:38:39 -0000	1.146
@@ -962,10 +962,6 @@
 cairo_private cairo_status_t
 _cairo_gstate_set_source (cairo_gstate_t *gstate, cairo_pattern_t *source);
 
-cairo_status_t
-_cairo_gstate_set_source_solid (cairo_gstate_t	    *gstate,
-				const cairo_color_t *color);
-
 cairo_private cairo_pattern_t *
 _cairo_gstate_get_source (cairo_gstate_t *gstate);
 




More information about the cairo-commit mailing list