gl: Re-enable the CLEAR optimisation

It was temporarily disabled whilst the surface API was in flux.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-06 10:27:17 +00:00
parent a8cbb00784
commit 6b472e12ae

View file

@ -1161,19 +1161,17 @@ _cairo_gl_surface_paint (void *surface,
const cairo_pattern_t *source,
const cairo_clip_t *clip)
{
#if 0
/* simplify the common case of clearing the surface */
if (clip == NULL) {
if (op == CAIRO_OPERATOR_CLEAR)
return _cairo_gl_surface_clear (abstract_surface, CAIRO_COLOR_TRANSPARENT);
return _cairo_gl_surface_clear (surface, CAIRO_COLOR_TRANSPARENT);
else if (source->type == CAIRO_PATTERN_TYPE_SOLID &&
(op == CAIRO_OPERATOR_SOURCE ||
(op == CAIRO_OPERATOR_OVER && _cairo_pattern_is_opaque_solid (source)))) {
return _cairo_gl_surface_clear (abstract_surface,
return _cairo_gl_surface_clear (surface,
&((cairo_solid_pattern_t *) source)->color);
}
}
#endif
return _cairo_compositor_paint (get_compositor (surface), surface,
op, source, clip);