gstate: Remove unused code

_cairo_gstate_redirect_target asserts that this surface is NULL
immediately before destroying it. If the code is compiled with
assertions disabled and the assert would be false, it is now safer
because instead of an invalid access it will only memleak.

_cairo_gstate_get_parent_target () is not used anymore in
cairo_pop_group () and the related code can be removed.

_cairo_gstate_is_redirected () has never been used.

The comment about the clipping is misleading, because the clip is
translated as expected since fb7f7c2f27.
This commit is contained in:
Andrea Canciani 2011-01-19 23:22:31 +01:00
parent 5d95ae924e
commit ff9e962165
2 changed files with 0 additions and 39 deletions

View file

@ -90,18 +90,12 @@ _cairo_gstate_restore (cairo_gstate_t **gstate, cairo_gstate_t **freelist);
cairo_private cairo_bool_t
_cairo_gstate_is_group (cairo_gstate_t *gstate);
cairo_private cairo_bool_t
_cairo_gstate_is_redirected (cairo_gstate_t *gstate);
cairo_private cairo_status_t
_cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child);
cairo_private cairo_surface_t *
_cairo_gstate_get_target (cairo_gstate_t *gstate);
cairo_private cairo_surface_t *
_cairo_gstate_get_parent_target (cairo_gstate_t *gstate);
cairo_private cairo_surface_t *
_cairo_gstate_get_original_target (cairo_gstate_t *gstate);

View file

@ -303,10 +303,6 @@ _cairo_gstate_restore (cairo_gstate_t **gstate, cairo_gstate_t **freelist)
* Redirect @gstate rendering to a "child" target. The original
* "parent" target with which the gstate was created will not be
* affected. See _cairo_gstate_get_target().
*
* Unless the redirected target has the same device offsets as the
* original #cairo_t target, the clip will be INVALID after this call,
* and the caller should either recreate or reset the clip.
**/
cairo_status_t
_cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child)
@ -320,7 +316,6 @@ _cairo_gstate_redirect_target (cairo_gstate_t *gstate, cairo_surface_t *child)
/* Set up our new parent_target based on our current target;
* gstate->parent_target will take the ref that is held by gstate->target
*/
cairo_surface_destroy (gstate->parent_target);
gstate->parent_target = gstate->target;
/* Now set up our new target; we overwrite gstate->target directly,
@ -357,21 +352,6 @@ _cairo_gstate_is_group (cairo_gstate_t *gstate)
return gstate->parent_target != NULL;
}
/**
* _cairo_gstate_is_redirected
* @gstate: a #cairo_gstate_t
*
* This space left intentionally blank.
*
* Return value: %TRUE if the gstate is redirected to a target
* different than the original, %FALSE otherwise.
**/
cairo_bool_t
_cairo_gstate_is_redirected (cairo_gstate_t *gstate)
{
return (gstate->target != gstate->original_target);
}
/**
* _cairo_gstate_get_target:
* @gstate: a #cairo_gstate_t
@ -387,19 +367,6 @@ _cairo_gstate_get_target (cairo_gstate_t *gstate)
return gstate->target;
}
/**
* _cairo_gstate_get_parent_target:
* @gstate: a #cairo_gstate_t
*
* Return the parent surface of the current drawing target surface;
* if this particular gstate isn't a redirect gstate, this will return %NULL.
**/
cairo_surface_t *
_cairo_gstate_get_parent_target (cairo_gstate_t *gstate)
{
return gstate->parent_target;
}
/**
* _cairo_gstate_get_original_target:
* @gstate: a #cairo_gstate_t