Eliminate unclipped CLEAR from meta-surface playback

The optimization that avoids replaying commands prior to an unclipped
CLEAR operation now starts playback from the first command after the
CLEAR. This avoids the need to handle the unclipped CLEAR in the PDF
surface.
(cherry picked from commit 875e32178e)
This commit is contained in:
Adrian Johnson 2007-09-05 22:51:13 +09:30 committed by Carl Worth
parent 11d83334ce
commit fce1a3fdd4

View file

@ -243,12 +243,6 @@ _cairo_meta_surface_paint (void *abstract_surface,
cairo_meta_surface_t *meta = abstract_surface;
cairo_command_paint_t *command;
/* An optimisation that takes care to not replay what was done
* before surface is cleared. We don't erase recorded commands
* since we may have earlier snapshots of this surface. */
if (op == CAIRO_OPERATOR_CLEAR && !meta->is_clipped)
meta->replay_start_idx = meta->commands.num_elements;
command = malloc (sizeof (cairo_command_paint_t));
if (command == NULL)
return CAIRO_STATUS_NO_MEMORY;
@ -264,6 +258,12 @@ _cairo_meta_surface_paint (void *abstract_surface,
if (status)
goto CLEANUP_SOURCE;
/* An optimisation that takes care to not replay what was done
* before surface is cleared. We don't erase recorded commands
* since we may have earlier snapshots of this surface. */
if (op == CAIRO_OPERATOR_CLEAR && !meta->is_clipped)
meta->replay_start_idx = meta->commands.num_elements;
return CAIRO_STATUS_SUCCESS;
CLEANUP_SOURCE: