summaryrefslogtreecommitdiff
path: root/src/cairo-gstate.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-02-25 13:03:42 +0000
committerCarl Worth <cworth@cworth.org>2005-02-25 13:03:42 +0000
commitebec6df7a77f1c778b69e36d562423a3ffd6edfb (patch)
treed8113dedaf49ab029c18612798d9a0c44aaf520d /src/cairo-gstate.c
parent03e7e13cb1412c29ebd1f1c8b46db3849e089557 (diff)
From David Reveman:
Simplify code to eliminate a goto.
Diffstat (limited to 'src/cairo-gstate.c')
-rw-r--r--src/cairo-gstate.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 1ad7e667c..003cbf886 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -2026,23 +2026,17 @@ _cairo_gstate_show_surface (cairo_gstate_t *gstate,
{
_cairo_rectangle_intersect (&extents, &gstate->clip.rect);
- /* Shortcut if empty */
- if (_cairo_rectangle_empty (&extents)) {
- status = CAIRO_STATUS_SUCCESS;
- goto BAIL1;
+ /* We only need to composite if the rectangle is not empty. */
+ if (!_cairo_rectangle_empty (&extents)) {
+ status = _cairo_surface_composite (gstate->operator,
+ &pattern,
+ gstate->clip.surface,
+ gstate->surface,
+ extents.x, extents.y,
+ 0, 0,
+ extents.x, extents.y,
+ extents.width, extents.height);
}
-
- status = _cairo_surface_composite (gstate->operator,
- &pattern,
- gstate->clip.surface,
- gstate->surface,
- extents.x, extents.y,
- 0, 0,
- extents.x, extents.y,
- extents.width, extents.height);
-
- BAIL1:
- ;
}
else
{