[cairo-commit] src/cairo-clip.c
Andrea Canciani
ranma42 at kemper.freedesktop.org
Sat Jan 22 02:59:25 PST 2011
src/cairo-clip.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit b51520628de73d5f560720c20987e5be5440edb0
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Sat Jan 22 11:56:37 2011 +0100
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().
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index f890c07..696c5b1 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -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);
}
More information about the cairo-commit
mailing list