gles2: update texture only if needed
authorPekka Paalanen <ppaalanen@gmail.com>
Wed, 7 Nov 2012 10:25:13 +0000 (12:25 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 8 Nov 2012 21:56:26 +0000 (16:56 -0500)
commitbcdd579a589bef54881d5067d3d1619f6199d6d7
tree1c0a23debb72bc6d5733f7e72662a8c9963b5fd1
parenta51e6fa322a24979ec04d7cdec08d3bdcf279b12
gles2: update texture only if needed

When a surface is on a non-primary plane (overlay), we do not need to
keep the GL texture up-to-date, since we are not using it. Avoid calling
glTex(Sub)Image2D in that case, and accumulate the texture damage
separately.

This is especially useful for backends, that can put wl_shm buffers into
overlays.

The empty damage check has to be moved from surface_accumulate_damage()
into gles2_renderer_flush_damage(), because it really needs to check the
accumulated damage, not only the current damage. Otherwise, if a surface
migrates from a plane to the primary plane, and does not have new
damage, the texture would not be updated even for accumulated damage.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/compositor.c
src/compositor.h
src/gles2-renderer.c