SHM: Don't flush damage when there is none

Every single frame, we were calling the flush_damage handler in the
renderer.  For GLES2 with subimage, this wasn't too bad as we'd never
call glTexSubImage2D, but without it, we'd upload the entire frame
through glTexImage2D every time.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Daniel Stone 2012-11-07 17:51:42 +11:00 committed by Kristian Høgsberg
parent 8097274ce6
commit c31f3dd679

View File

@ -905,7 +905,8 @@ static void
surface_accumulate_damage(struct weston_surface *surface,
pixman_region32_t *opaque)
{
if (surface->buffer && wl_buffer_is_shm(surface->buffer))
if (pixman_region32_not_empty(&surface->damage) &&
surface->buffer && wl_buffer_is_shm(surface->buffer))
surface->compositor->renderer->flush_damage(surface);
if (surface->transform.enabled) {