mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 23:30:09 +01:00
clip: Improve _cairo_clip_contains_*
_cairo_clip_contains_rectangle() considered a NULL clip empty instead of containing everything. _cairo_clip_contains_rectangle() checks for NULL clips, so we don't have to check for them in _cairo_clip_contains_extents().
This commit is contained in:
parent
47d14586f5
commit
b51520628d
1 changed files with 2 additions and 4 deletions
|
|
@ -1109,8 +1109,9 @@ _cairo_clip_contains_rectangle (cairo_clip_t *clip,
|
|||
{
|
||||
cairo_clip_path_t *clip_path;
|
||||
|
||||
/* clip == NULL means no clip, so the clip contains everything */
|
||||
if (clip == NULL)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
|
||||
clip_path = clip->path;
|
||||
if (clip_path->extents.x > rect->x ||
|
||||
|
|
@ -1148,9 +1149,6 @@ _cairo_clip_contains_extents (cairo_clip_t *clip,
|
|||
{
|
||||
const cairo_rectangle_int_t *rect;
|
||||
|
||||
if (clip == NULL)
|
||||
return FALSE;
|
||||
|
||||
rect = extents->is_bounded ? &extents->bounded : &extents->unbounded;
|
||||
return _cairo_clip_contains_rectangle (clip, rect);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue