tpl_result_t (*set_rotation_capability)(tpl_surface_t *surface,
tpl_bool_t set);
tpl_result_t (*set_post_interval)(tpl_surface_t *surface, int post_interval);
+
+ void (*get_size)(tpl_surface_t *surface, int *width, int *height);
};
struct _tpl_object {
return TPL_ERROR_INVALID_PARAMETER;
}
- if (width) *width = surface->width;
-
- if (height) *height = surface->height;
+ if (surface->backend.get_size) {
+ surface->backend.get_size(surface, width, height);
+ }
+ else {
+ if (width) *width = surface->width;
+ if (height) *height = surface->height;
+ }
return TPL_ERROR_NONE;
}
return tbm_surface;
}
+void
+__tpl_wl_egl_surface_get_size(tpl_surface_t *surface, int *width, int *height)
+{
+ tpl_wayland_egl_surface_t *wayland_egl_surface =
+ (tpl_wayland_egl_surface_t *)surface->backend.data;
+
+ if (width)
+ *width = tbm_surface_queue_get_width(wayland_egl_surface->tbm_queue);
+ if (height)
+ *height = tbm_surface_queue_get_height(wayland_egl_surface->tbm_queue);
+}
+
+
tpl_bool_t
__tpl_display_choose_backend_wl_egl_thread(tpl_handle_t native_dpy)
{
__tpl_wl_egl_surface_set_rotation_capability;
backend->set_post_interval =
__tpl_wl_egl_surface_set_post_interval;
+ backend->get_size =
+ __tpl_wl_egl_surface_get_size;
}