diff options
-rw-r--r-- | src/cairo-pattern.c | 31 | ||||
-rw-r--r-- | src/cairoint.h | 1 |
2 files changed, 4 insertions, 28 deletions
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 1e9326d3..7fab4f33 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -587,17 +587,7 @@ _cairo_pattern_create_in_error (cairo_status_t status) cairo_pattern_t * cairo_pattern_create_rgb (double red, double green, double blue) { - cairo_color_t color; - - red = _cairo_restrict_value (red, 0.0, 1.0); - green = _cairo_restrict_value (green, 0.0, 1.0); - blue = _cairo_restrict_value (blue, 0.0, 1.0); - - _cairo_color_init_rgb (&color, red, green, blue); - - CAIRO_MUTEX_INITIALIZE (); - - return _cairo_pattern_create_solid (&color); + return cairo_pattern_create_rgba (red, green, blue, 1.0); } slim_hidden_def (cairo_pattern_create_rgb); @@ -1821,23 +1811,7 @@ cairo_pattern_add_color_stop_rgb (cairo_pattern_t *pattern, double green, double blue) { - if (pattern->status) - return; - - if (pattern->type != CAIRO_PATTERN_TYPE_LINEAR && - pattern->type != CAIRO_PATTERN_TYPE_RADIAL) - { - _cairo_pattern_set_error (pattern, CAIRO_STATUS_PATTERN_TYPE_MISMATCH); - return; - } - - offset = _cairo_restrict_value (offset, 0.0, 1.0); - red = _cairo_restrict_value (red, 0.0, 1.0); - green = _cairo_restrict_value (green, 0.0, 1.0); - blue = _cairo_restrict_value (blue, 0.0, 1.0); - - _cairo_pattern_add_color_stop ((cairo_gradient_pattern_t *) pattern, - offset, red, green, blue, 1.0); + cairo_pattern_add_color_stop_rgba (pattern, offset, red, green, blue, 1.0); } /** @@ -1894,6 +1868,7 @@ cairo_pattern_add_color_stop_rgba (cairo_pattern_t *pattern, _cairo_pattern_add_color_stop ((cairo_gradient_pattern_t *) pattern, offset, red, green, blue, alpha); } +slim_hidden_def (cairo_pattern_add_color_stop_rgba); /** * cairo_pattern_set_matrix: diff --git a/src/cairoint.h b/src/cairoint.h index 424457f1..121676ca 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -2438,6 +2438,7 @@ slim_hidden_proto (cairo_matrix_translate); slim_hidden_proto (cairo_move_to); slim_hidden_proto (cairo_new_path); slim_hidden_proto (cairo_paint); +slim_hidden_proto (cairo_pattern_add_color_stop_rgba); slim_hidden_proto (cairo_pattern_create_for_surface); slim_hidden_proto (cairo_pattern_create_rgb); slim_hidden_proto (cairo_pattern_create_rgba); |