EGL_KHR_swap_buffers_with_damage#

Supported Hardware#

Series6, Series6XE, Series6XT

Valid APIs#

EGL 1.4

Description#

This extension provides a means to issue a swap buffers request to display the contents of the current back buffer and also specify a list of damage rectangles that can be passed to a system compositor so it can minimize how much it has to recompose.

This should be used in situations where an application is only animating a small portion of a surface since it enables the compositor to avoid wasting time recomposing parts of the surface that haven’t changed.

Note#

Requires EGL 1.4 This extension is written against the wording of the EGL 1.4 Specification. Different with EGL_KHR_partial_update. EGL_KHR_swap_buffers_with_damage concerns the area of the surface that changes between frames for that surface. It concerns the differences between two buffers - the current back buffer and the current front buffer. It is useful only to the consumer.

Surface Damage Example#

The surface damage for frame n is the difference between frame n and frame (n-1) and represents the area that a compositor must recompose.

  Frame 0     Frame 1     Frame 2     Frame 3     Frame 4
+---------+ +---------+ +---------+ +---------+ +---------+
|         | |#########| |#########| |#########| |#########|
|         | |         | |#########| |#########| |#########| Final surface
|         | |         | |         | |#########| |#########|   content
|         | |         | |         | |         | |#########|
+---------+ +---------+ +---------+ +---------+ +---------+
+---------+ +---------+ +---------+ +---------+ +---------+
|@@@@@@@@@| |@@@@@@@@@| |         | |         | |         |
|@@@@@@@@@| |         | |@@@@@@@@@| |         | |         | Surface damage
|@@@@@@@@@| |         | |         | |@@@@@@@@@| |         |
|@@@@@@@@@| |         | |         | |         | |@@@@@@@@@|
+---------+ +---------+ +---------+ +---------+ +---------+

Example#

//As an alternative to eglSwapBuffers
eglSwapBuffersWithDamageKHR(eglDisplay, eglSurface, rects, n_rects);