tpl_wayland_egl_surface_t *wayland_egl_surface;
int dx, dy;
int width, height;
- int rotation;
+ int transform;
tbm_bo bo;
+ tpl_bool_t rotated; /* TRUE if need to call wl_surface_set_buffer_transform */
tpl_bool_t reset; /* TRUE if queue reseted by external */
tpl_bool_t is_new; /* for frontbuffer mode */
struct wl_proxy *wl_proxy; /* wl_buffer proxy */
tpl_wayland_egl_surface_t *wayland_egl_surface =
(tpl_wayland_egl_surface_t *) surface->backend.data;
tdm_error tdm_err = 0;
+ uint32_t version;
wayland_egl_buffer =
__tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface);
TPL_IMAGE_DUMP(tbm_surface, surface->width, surface->height);
+ version = wl_proxy_get_version((struct wl_proxy *)wl_egl_window->surface);
+
+ if (wayland_egl_buffer->rotated == TPL_TRUE) {
+ wl_surface_set_buffer_transform(wl_egl_window->surface,
+ wayland_egl_buffer->transform);
+ }
+
wl_surface_attach(wl_egl_window->surface, (void *)wayland_egl_buffer->wl_proxy,
wayland_egl_buffer->dx, wayland_egl_buffer->dy);
wl_egl_window->attached_height = wayland_egl_buffer->height;
if (num_rects < 1 || rects == NULL) {
- wl_surface_damage(wl_egl_window->surface,
- wayland_egl_buffer->dx, wayland_egl_buffer->dy,
- wayland_egl_buffer->width, wayland_egl_buffer->height);
+ if (version < 4) {
+ wl_surface_damage(wl_egl_window->surface,
+ wayland_egl_buffer->dx,
+ wayland_egl_buffer->dy,
+ wayland_egl_buffer->width,
+ wayland_egl_buffer->height);
+ } else {
+ wl_surface_damage_buffer(wl_egl_window->surface,
+ wayland_egl_buffer->dx,
+ wayland_egl_buffer->dy,
+ wayland_egl_buffer->width,
+ wayland_egl_buffer->height);
+ }
} else {
int i;
* y = [WINDOW.HEIGHT] - (RECT.Y + RECT.HEIGHT) */
int inverted_y =
wayland_egl_buffer->height - (rects[i * 4 + 1] + rects[i * 4 + 3]);
- wl_surface_damage(wl_egl_window->surface,
- rects[i * 4 + 0], inverted_y,
- rects[i * 4 + 2], rects[i * 4 + 3]);
+ if (version < 4) {
+ wl_surface_damage(wl_egl_window->surface,
+ rects[i * 4 + 0], inverted_y,
+ rects[i * 4 + 2], rects[i * 4 + 3]);
+ } else {
+ wl_surface_damage_buffer(wl_egl_window->surface,
+ rects[i * 4 + 0], inverted_y,
+ rects[i * 4 + 2], rects[i * 4 + 3]);
+ }
}
}
wayland_egl_buffer->dy = wl_egl_window->dy;
wayland_egl_buffer->width = wl_egl_window->width;
wayland_egl_buffer->height = wl_egl_window->height;
- wayland_egl_buffer->rotation = wl_egl_window->rotation;
+ if (wayland_egl_buffer->transform != wl_egl_window->transform) {
+ wayland_egl_buffer->transform = wl_egl_window->transform;
+ wayland_egl_buffer->rotated = TPL_TRUE;
+ } else {
+ wayland_egl_buffer->rotated = TPL_FALSE;
+ }
wayland_egl_buffer->reset = TPL_FALSE;
if (wayland_egl_surface->is_activated != is_activated)
wayland_egl_buffer->dy = wl_egl_window->dy;
wayland_egl_buffer->width = wl_egl_window->width;
wayland_egl_buffer->height = wl_egl_window->height;
- wayland_egl_buffer->rotation = wl_egl_window->rotation;
+ wayland_egl_buffer->transform = wl_egl_window->transform;
+ wayland_egl_buffer->rotated = TPL_FALSE;
wayland_egl_buffer->display = wayland_egl_display;
wayland_egl_buffer->wl_proxy = wl_proxy;
wayland_egl_buffer->bo = tbm_surface_internal_get_bo(tbm_surface, 0);