OSDN Git Service

egl/wayland: Ignore rects from SwapBuffersWithDamage
authorDaniel Stone <daniels@collabora.com>
Sat, 7 Nov 2015 18:25:31 +0000 (18:25 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Dec 2015 18:43:12 +0000 (18:43 +0000)
commit83d4fa41039b678bb2f0d5c099f4b23030338041
tree938b51e583f678dae03bdf4e64977612dcf64fde
parentc1f1c5edaa8fc39d7582e505c446f7a8ae11c4f2
egl/wayland: Ignore rects from SwapBuffersWithDamage

eglSwapBuffersWithDamage accepts damage-region rectangles to hint the
compositor that it only needs to redraw certain areas, which was passed
through the wl_surface_damage request, as designed.

Wayland also offers a buffer transformation interface, e.g. to allow
users to render pre-rotated buffers. Unfortunately, there is no way to
query buffer transforms, and the damage region was provided in surface,
rather than buffer, co-ordinate space.

Users could in theory account for this themselves, but EGL also requires
co-ordinates to be passed in GL/mathematical co-ordinate space, with an
inversion to Wayland's natural/scanout co-ordinate space, so
transformations other than a 180-degree rotation will fail as EGL
attempts to subtract the region from (its view of the) surface height.

Pending creation and acceptance of a wl_surface.buffer_damage request,
which will accept co-ordinates in buffer co-ordinate space, pessimise to
always sending full-surface damage.

bce64c6c provides the explanation for why we send maximum-range damage,
rather than the full size of the surface: in the presence of buffer
transformations, full-surface damage may not actually cover the entire
surface.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit d1314de293e9e4a63c35f094c3893aaaed8580b4)
src/egl/drivers/dri2/platform_wayland.c