recording: Avoid indirection through indices array if not reduced

If we don't discard any elements, then the index array is simply a 1:1
mapping of the element array, and we may as well bypass it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-02-12 10:24:08 +00:00
parent 14237f1143
commit be1561dade

View file

@ -1654,7 +1654,7 @@ _cairo_recording_surface_replay_internal (cairo_recording_surface_t *surface,
if (extents.width < r->width || extents.height < r->height) {
num_elements =
_cairo_recording_surface_get_visible_commands (surface, &extents);
use_indices = TRUE;
use_indices = num_elements != surface->commands.num_elements;
}
for (i = 0; i < num_elements; i++) {