- Wayland Window System Coordinate uses top-left position as (0,0) ,but GL Window Surface Coordinate uses bottom-left position as (0,0).
So, tpl_wayland_egl should covert "GL Window Surface Coordinate" to "Wayland Window System Coordinate" before calling of wl_surface_damage().
Wayland Window System Coordinate
(0,0) (Width,0)
+---------+
| |
| |
| |
| |
| |
+---------+
(0,Height) (Width, Height)
GL Window Surface Coordinate
(0,Height) (Width,Height)
+---------+
| |
| |
| |
| |
| |
+---------+
(0,0) (Width, 0)
* reference:
https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_buffer_age.txt
https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_partial_update.txt
Change-Id: I2cc0eadda428028ac2a53983e9a18c13378ee777
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
wl_egl_window->width, wl_egl_window->height);
} else {
int i;
+
for (i = 0; i < num_rects; i++) {
+ /* The rectangles are specified relative to the bottom-left of the
+ * GL surface. So, these rectanglesd has to be converted to
+ * WINDOW(Top-left) coord like below.
+ * y = [WINDOW.HEIGHT] - (RECT.Y + RECT.HEIGHT) */
+ int inverted_y =
+ wl_egl_window->height - (rects[i * 4 + 1] + rects[i * 4 + 3]);
wl_surface_damage(wl_egl_window->surface,
- rects[i * 4 + 0], rects[i * 4 + 1],
+ rects[i * 4 + 0], inverted_y,
rects[i * 4 + 2], rects[i * 4 + 3]);
}
}