From: Daniel Stone Date: Wed, 7 Nov 2012 06:51:42 +0000 (+1100) Subject: SHM: Don't flush damage when there is none X-Git-Tag: submit/2.0alpha-wayland/20121121.143012~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c31f3dd6797ee9a39c3c8714d86703ff7c93da93;p=profile%2Fivi%2Fweston.git 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 --- diff --git a/src/compositor.c b/src/compositor.c index 2d5b263..6b0c004 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -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) {