diff options
Diffstat (limited to 'src/cairo-pattern.c')
-rw-r--r-- | src/cairo-pattern.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 6bd3edfd8..2c0ba31f8 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -76,7 +76,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil = { CAIRO_FILTER_DEFAULT, /* filter */ CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ + FALSE, /* is_foreground_marker */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ 1.0 /* opacity */ } @@ -93,7 +93,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil_null_pointer = { CAIRO_FILTER_DEFAULT, /* filter */ CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ + FALSE, /* is_foreground_marker */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ 1.0 /* opacity */ } @@ -110,7 +110,7 @@ const cairo_solid_pattern_t _cairo_pattern_black = { CAIRO_FILTER_NEAREST, /* filter */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ + FALSE, /* is_foreground_marker */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ 1.0 /* opacity */ }, @@ -128,7 +128,7 @@ const cairo_solid_pattern_t _cairo_pattern_clear = { CAIRO_FILTER_NEAREST, /* filter */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ + FALSE, /* is_foreground_marker */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ 1.0 /* opacity */ }, @@ -146,7 +146,7 @@ const cairo_solid_pattern_t _cairo_pattern_white = { CAIRO_FILTER_NEAREST, /* filter */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ + FALSE, /* is_foreground_marker */ { 1., 0., 0., 1., 0., 0., }, /* matrix */ 1.0 /* opacity */ }, @@ -238,7 +238,7 @@ _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type) pattern->opacity = 1.0; pattern->has_component_alpha = FALSE; - pattern->is_userfont_foreground = FALSE; + pattern->is_foreground_marker = FALSE; cairo_matrix_init_identity (&pattern->matrix); @@ -561,6 +561,7 @@ _cairo_pattern_init_for_surface (cairo_surface_pattern_t *pattern, _cairo_pattern_init (&pattern->base, CAIRO_PATTERN_TYPE_SURFACE); pattern->surface = cairo_surface_reference (surface); + pattern->region_array_id = 0; } static void @@ -624,6 +625,14 @@ _cairo_pattern_create_solid (const cairo_color_t *color) } cairo_pattern_t * +_cairo_pattern_create_foreground_marker (void) +{ + cairo_pattern_t *pattern = _cairo_pattern_create_solid (CAIRO_COLOR_BLACK); + pattern->is_foreground_marker = TRUE; + return pattern; +} + +cairo_pattern_t * _cairo_pattern_create_in_error (cairo_status_t status) { cairo_pattern_t *pattern; @@ -681,6 +690,8 @@ slim_hidden_def (cairo_pattern_create_rgb); * 1. If the values passed in are outside that range, they will be * clamped. * + * The color is specified in the same way as in cairo_set_source_rgb(). + * * Return value: the newly created #cairo_pattern_t if successful, or * an error pattern in case of no memory. The caller owns the * returned object and should call cairo_pattern_destroy() when @@ -810,6 +821,7 @@ cairo_pattern_create_linear (double x0, double y0, double x1, double y1) return &pattern->base.base; } +slim_hidden_def (cairo_pattern_create_linear); /** * cairo_pattern_create_radial: @@ -864,6 +876,7 @@ cairo_pattern_create_radial (double cx0, double cy0, double radius0, return &pattern->base.base; } +slim_hidden_def (cairo_pattern_create_radial); /* This order is specified in the diagram in the documentation for * cairo_pattern_create_mesh() */ @@ -1044,6 +1057,7 @@ cairo_pattern_create_mesh (void) return &pattern->base; } +slim_hidden_def (cairo_pattern_create_mesh); /** * cairo_pattern_reference: @@ -1091,6 +1105,7 @@ cairo_pattern_get_type (cairo_pattern_t *pattern) { return pattern->type; } +slim_hidden_def (cairo_pattern_get_type); /** * cairo_pattern_status: @@ -1278,7 +1293,7 @@ cairo_mesh_pattern_begin_patch (cairo_pattern_t *pattern) for (i = 0; i < 4; i++) mesh->has_color[i] = FALSE; } - +slim_hidden_def (cairo_mesh_pattern_begin_patch); static void _calc_control_point (cairo_mesh_patch_t *patch, int control_point) @@ -1395,6 +1410,7 @@ cairo_mesh_pattern_end_patch (cairo_pattern_t *pattern) mesh->current_patch = NULL; } +slim_hidden_def (cairo_mesh_pattern_end_patch); /** * cairo_mesh_pattern_curve_to: @@ -2115,6 +2131,7 @@ cairo_pattern_set_extend (cairo_pattern_t *pattern, cairo_extend_t extend) pattern->extend = extend; _cairo_pattern_notify_observers (pattern, CAIRO_PATTERN_NOTIFY_EXTEND); } +slim_hidden_def (cairo_pattern_set_extend); /** * cairo_pattern_get_extend: @@ -3422,9 +3439,10 @@ use_bilinear(double x, double y, double t) /** * _cairo_pattern_analyze_filter: * @pattern: surface pattern - * Returns: the optimized #cairo_filter_t to use with @pattern. * * Possibly optimize the filter to a simpler value depending on transformation + * + * Returns: the optimized #cairo_filter_t to use with @pattern. **/ cairo_filter_t _cairo_pattern_analyze_filter (const cairo_pattern_t *pattern) @@ -4160,6 +4178,8 @@ _cairo_pattern_equal (const cairo_pattern_t *a, const cairo_pattern_t *b) * * Gets the solid color for a solid color pattern. * + * Note that the color and alpha values are not premultiplied. + * * Return value: %CAIRO_STATUS_SUCCESS, or * %CAIRO_STATUS_PATTERN_TYPE_MISMATCH if the pattern is not a solid * color pattern. @@ -4193,6 +4213,7 @@ cairo_pattern_get_rgba (cairo_pattern_t *pattern, return CAIRO_STATUS_SUCCESS; } +slim_hidden_def (cairo_pattern_get_rgba); /** * cairo_pattern_get_surface: @@ -4242,6 +4263,8 @@ cairo_pattern_get_surface (cairo_pattern_t *pattern, * where n is the number returned * by cairo_pattern_get_color_stop_count(). * + * Note that the color and alpha values are not premultiplied. + * * Return value: %CAIRO_STATUS_SUCCESS, or %CAIRO_STATUS_INVALID_INDEX * if @index is not valid for the given pattern. If the pattern is * not a gradient pattern, %CAIRO_STATUS_PATTERN_TYPE_MISMATCH is @@ -4549,6 +4572,8 @@ slim_hidden_def (cairo_mesh_pattern_get_path); * Valid values for @corner_num are from 0 to 3 and identify the * corners as explained in cairo_pattern_create_mesh(). * + * Note that the color and alpha values are not premultiplied. + * * Return value: %CAIRO_STATUS_SUCCESS, or %CAIRO_STATUS_INVALID_INDEX * if @patch_num or @corner_num is not valid for @pattern. If * @pattern is not a mesh pattern, %CAIRO_STATUS_PATTERN_TYPE_MISMATCH |