mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-30 02:40:13 +01:00
pattern: Do not provide type field in cairo_pattern_union_t
The type field is accessible through the base.type field. This makes it possible to change the layout of cairo_pattern_t and move the type field without breaking cairo_pattern_union_t.
This commit is contained in:
parent
b39d3d4b53
commit
1f2dc2e06a
3 changed files with 2 additions and 3 deletions
|
|
@ -1062,7 +1062,7 @@ _cairo_gstate_mask (cairo_gstate_t *gstate,
|
|||
_cairo_gstate_copy_transformed_mask (gstate, &mask_pattern.base, mask);
|
||||
|
||||
if (source->type == CAIRO_PATTERN_TYPE_SOLID &&
|
||||
mask_pattern.type == CAIRO_PATTERN_TYPE_SOLID &&
|
||||
mask_pattern.base.type == CAIRO_PATTERN_TYPE_SOLID &&
|
||||
_cairo_operator_bounded_by_source (op))
|
||||
{
|
||||
const cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) source;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ typedef struct _cairo_mesh_pattern {
|
|||
} cairo_mesh_pattern_t;
|
||||
|
||||
typedef union {
|
||||
cairo_pattern_type_t type;
|
||||
cairo_pattern_t base;
|
||||
|
||||
cairo_solid_pattern_t solid;
|
||||
|
|
|
|||
|
|
@ -3674,7 +3674,7 @@ _cairo_pattern_is_clear (const cairo_pattern_t *abstract_pattern)
|
|||
return FALSE;
|
||||
|
||||
pattern = (cairo_pattern_union_t *) abstract_pattern;
|
||||
switch (pattern->type) {
|
||||
switch (abstract_pattern->type) {
|
||||
case CAIRO_PATTERN_TYPE_SOLID:
|
||||
return CAIRO_COLOR_IS_CLEAR (&pattern->solid.color);
|
||||
case CAIRO_PATTERN_TYPE_SURFACE:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue