mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-07 11:20:27 +01:00
From David Reveman:
Simplify code to eliminate a goto.
This commit is contained in:
parent
03e7e13cb1
commit
ebec6df7a7
3 changed files with 27 additions and 32 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2005-02-25 Carl Worth <cworth@cworth.org>
|
||||
|
||||
From David Reveman:
|
||||
|
||||
* src/cairo_gstate.c (_cairo_gstate_show_surface): Simplify code
|
||||
to eliminate a goto.
|
||||
|
||||
2005-02-25 Carl Worth <cworth@cworth.org>
|
||||
|
||||
From David Reveman:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue