#define KEY_WL_EGL_BUFFER (unsigned long)(&wl_egl_buffer_key)
/* In wayland, application and compositor create its own drawing buffers. Recommend size is more than 2. */
-#define CLIENT_QUEUE_SIZE 3
-#define BUFFER_ARRAY_SIZE (CLIENT_QUEUE_SIZE * 2)
+#define BUFFER_ARRAY_SIZE 9
typedef struct _tpl_wl_egl_display tpl_wl_egl_display_t;
typedef struct _tpl_wl_egl_surface tpl_wl_egl_surface_t;
tpl_gsource *surf_source;
tbm_surface_queue_h tbm_queue;
+ int num_buffers;
struct wl_egl_window *wl_egl_window;
struct wl_surface *wl_surface;
wl_egl_surface->width = wl_egl_window->width;
wl_egl_surface->height = wl_egl_window->height;
wl_egl_surface->format = surface->format;
+ wl_egl_surface->num_buffers = surface->num_buffers;
wl_egl_surface->surf_source = surf_source;
wl_egl_surface->wl_egl_window = wl_egl_window;
wl_egl_surface->tbm_queue = _thread_create_tbm_queue(
wl_egl_surface,
wl_egl_display->wl_tbm_client,
- CLIENT_QUEUE_SIZE);
+ wl_egl_surface->num_buffers);
if (!wl_egl_surface->tbm_queue) {
TPL_ERR("Failed to create tbm_queue. wl_egl_surface(%p) wl_tbm_client(%p)",
wl_egl_surface, wl_egl_display->wl_tbm_client);
wl_egl_surface->tbm_queue,
wl_egl_surface->width,
wl_egl_surface->height,
- CLIENT_QUEUE_SIZE,
+ wl_egl_surface->num_buffers,
wl_egl_surface->format);
if (wl_egl_display->use_wait_vblank) {