mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-22 10:00:26 +01:00
[pattern] Ignore matrix/filter/extend when comparing solids
Solid patterns do not use their matrices, filter or extend properties so ignore them for the purposes of comparing and hashing.
This commit is contained in:
parent
bb919584c0
commit
005b195f06
1 changed files with 16 additions and 9 deletions
|
|
@ -2586,9 +2586,14 @@ _cairo_pattern_hash (const cairo_pattern_t *pattern)
|
|||
return 0;
|
||||
|
||||
hash = _cairo_hash_bytes (hash, &pattern->type, sizeof (pattern->type));
|
||||
hash = _cairo_hash_bytes (hash, &pattern->matrix, sizeof (pattern->matrix));
|
||||
hash = _cairo_hash_bytes (hash, &pattern->filter, sizeof (pattern->filter));
|
||||
hash = _cairo_hash_bytes (hash, &pattern->extend, sizeof (pattern->extend));
|
||||
if (pattern->type != CAIRO_PATTERN_TYPE_SOLID) {
|
||||
hash = _cairo_hash_bytes (hash,
|
||||
&pattern->matrix, sizeof (pattern->matrix));
|
||||
hash = _cairo_hash_bytes (hash,
|
||||
&pattern->filter, sizeof (pattern->filter));
|
||||
hash = _cairo_hash_bytes (hash,
|
||||
&pattern->extend, sizeof (pattern->extend));
|
||||
}
|
||||
|
||||
switch (pattern->type) {
|
||||
case CAIRO_PATTERN_TYPE_SOLID:
|
||||
|
|
@ -2745,14 +2750,16 @@ _cairo_pattern_equal (const cairo_pattern_t *a, const cairo_pattern_t *b)
|
|||
if (a->type != b->type)
|
||||
return FALSE;
|
||||
|
||||
if (memcmp (&a->matrix, &b->matrix, sizeof (cairo_matrix_t)))
|
||||
return FALSE;
|
||||
if (a->type != CAIRO_PATTERN_TYPE_SOLID) {
|
||||
if (memcmp (&a->matrix, &b->matrix, sizeof (cairo_matrix_t)))
|
||||
return FALSE;
|
||||
|
||||
if (a->filter != b->filter)
|
||||
return FALSE;
|
||||
if (a->filter != b->filter)
|
||||
return FALSE;
|
||||
|
||||
if (a->extend != b->extend)
|
||||
return FALSE;
|
||||
if (a->extend != b->extend)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch (a->type) {
|
||||
case CAIRO_PATTERN_TYPE_SOLID:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue