mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 15:48:00 +02:00
[cairo-color] Only compare the shorts for equality.
By only checking the premultiplied shorts inside the cairo_color_t we only have to compare at most 8 bytes instead of the full 24 bytes.
This commit is contained in:
parent
966a39396e
commit
d81907734e
1 changed files with 4 additions and 1 deletions
|
|
@ -165,5 +165,8 @@ cairo_bool_t
|
|||
_cairo_color_equal (const cairo_color_t *color_a,
|
||||
const cairo_color_t *color_b)
|
||||
{
|
||||
return memcmp (color_a, color_b, sizeof (cairo_color_t)) == 0;
|
||||
return color_a->red_short == color_b->red_short &&
|
||||
color_a->green_short == color_b->green_short &&
|
||||
color_a->blue_short == color_b->blue_short &&
|
||||
color_a->alpha_short == color_b->alpha_short;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue