return EINA_TRUE;
}
-static void
+static Eina_Bool
_e_hwc_window_client_recover(E_Hwc_Window *hwc_window)
{
E_Comp_Wl_Buffer *recover_buffer = NULL;;
tbm_surface_h tsurface =NULL;
E_Client *ec = NULL;
- if (hwc_window->is_deleted) return;
+ if (hwc_window->is_deleted) return EINA_FALSE;
ec = hwc_window->ec;
- if (!ec) return;
+ if (!ec) return EINA_FALSE;
- if (e_object_is_del(E_OBJECT(ec))) return;
+ if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
recover_buffer = _e_hwc_window_comp_wl_buffer_get(hwc_window);
+
+ if ((!recover_buffer) &&
+ (!evas_object_visible_get(ec->frame)) &&
+ (ec->exp_iconify.buffer_flush) &&
+ (e_policy_visibility_client_is_iconic(ec)))
+ return EINA_FALSE;
+
if (!recover_buffer)
{
tsurface = e_hwc_window_displaying_surface_get(hwc_window);
- if (!tsurface) return;
+ if (!tsurface) return EINA_FALSE;
recover_buffer = e_comp_wl_tbm_buffer_get(tsurface);
- EINA_SAFETY_ON_NULL_RETURN(recover_buffer);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(recover_buffer, EINA_FALSE);
}
EHWTRACE("Recover ts:%p -- {%s}",
e_comp_wl_surface_attach(ec, recover_buffer);
e_hwc_window_buffer_fetch(hwc_window);
+
+ return EINA_TRUE;
}
static Eina_Bool
_e_hwc_window_rendered_window_set(E_Hwc_Window *hwc_window, Eina_Bool set)
{
E_Client *ec = NULL;
+ Eina_Bool ret;
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
if (set)
{
- _e_hwc_window_client_recover(hwc_window);
+ ret = _e_hwc_window_client_recover(hwc_window);
if (hwc_window->ec->redirected)
{
- e_pixmap_image_refresh(ec->pixmap);
- e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
- e_comp_object_dirty(ec->frame);
- e_comp_object_render(ec->frame);
+ if (ret)
+ {
+ e_pixmap_image_refresh(ec->pixmap);
+ e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+ e_comp_object_dirty(ec->frame);
+ e_comp_object_render(ec->frame);
+ }
e_comp_object_redirected_set(ec->frame, EINA_TRUE);
return EINA_FALSE;
}
-static Eina_Bool
+static tbm_surface_h
_e_hwc_window_queue_backup_buffer_set(E_Hwc_Window *hwc_window, Eina_Bool attach)
{
E_Comp_Wl_Buffer *comp_buffer = NULL, *backup_buffer = NULL;
uint32_t flags = 0;
E_Client *ec = hwc_window->ec;
- if (!ec) return EINA_FALSE;
+ if (!ec) return NULL;
comp_buffer = _comp_wl_buffer_get(hwc_window->ec);
- if (!comp_buffer) return EINA_FALSE;
- if (!comp_buffer->tbm_surface) return EINA_FALSE;
+ if (!comp_buffer) return NULL;
+ if (!comp_buffer->tbm_surface) return NULL;
tsurface = comp_buffer->tbm_surface;
{
flags = _comp_wl_buffer_flags_get(comp_buffer);
if (flags != E_HWC_WINDOW_QUEUE_BUFFER_FLAGS)
- return EINA_FALSE;
+ return NULL;
}
else
{
if (tsurface != hwc_window->display.buffer.tsurface)
- return EINA_FALSE;
+ return NULL;
if (!hwc_window->display.buffer.from_queue)
- return EINA_FALSE;
+ return NULL;
}
EHWQINF("Backup buffer get ehw:%p origin:%p",
comp_buffer->tbm_surface);
backup_buffer = _comp_wl_backup_buffer_get(tsurface);
- EINA_SAFETY_ON_NULL_RETURN_VAL(backup_buffer, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(backup_buffer, NULL);
if (comp_buffer)
backup_buffer->transform = comp_buffer->transform;
e_pixmap_refresh(ec->pixmap);
}
- return EINA_TRUE;
+ return tsurface;
}
static Eina_Bool
{
struct wayland_tbm_client_queue *cqueue = NULL;
E_Hwc_Window *hwc_window = queue->user;
+ tbm_surface_h tsurface;
+ E_Hwc_Window_Queue_Buffer *queue_buffer;
- if (hwc_window && hwc_window->ec)
- {
- cqueue = _user_cqueue_get(hwc_window->ec);
- if (cqueue)
- wayland_tbm_server_client_queue_set_wait_usable_cb(cqueue, NULL, NULL);
-
- if (_e_hwc_window_queue_backup_buffer_set(hwc_window, EINA_TRUE))
- {
- if(hwc_window->render_target)
- {
- e_pixmap_image_refresh(hwc_window->ec->pixmap);
- e_comp_object_damage(hwc_window->ec->frame, 0, 0,
- hwc_window->ec->w, hwc_window->ec->h);
- e_comp_object_dirty(hwc_window->ec->frame);
- e_comp_object_render(hwc_window->ec->frame);
- }
- }
- }
+ /* queue retrieve the buffers from the hwc_window */
+ _e_hwc_window_queue_buffers_retrieve(queue, queue->user);
tbm_surface_queue_remove_dequeuable_cb(queue->tqueue,
_e_hwc_window_queue_cb_dequeueable,
(void *)queue);
- /* queue retrieve the buffers from the hwc_window */
- _e_hwc_window_queue_buffers_retrieve(queue, queue->user);
+ if (!hwc_window || !hwc_window->ec) return;
+
+ cqueue = _user_cqueue_get(hwc_window->ec);
+ if (cqueue)
+ wayland_tbm_server_client_queue_set_wait_usable_cb(cqueue, NULL, NULL);
+
+ if ((!_comp_wl_buffer_get(hwc_window->ec)) &&
+ (!evas_object_visible_get(hwc_window->ec->frame)) &&
+ (hwc_window->ec->exp_iconify.buffer_flush) &&
+ (e_policy_visibility_client_is_iconic(hwc_window->ec)))
+ return;
+
+ tsurface = _e_hwc_window_queue_backup_buffer_set(hwc_window, EINA_TRUE);
+ if (tsurface)
+ {
+ if(hwc_window->render_target)
+ {
+ e_pixmap_image_refresh(hwc_window->ec->pixmap);
+ e_comp_object_damage(hwc_window->ec->frame, 0, 0,
+ hwc_window->ec->w, hwc_window->ec->h);
+ e_comp_object_dirty(hwc_window->ec->frame);
+ e_comp_object_render(hwc_window->ec->frame);
+ }
+
+ queue_buffer = e_hwc_window_queue_buffer_find(queue, tsurface);
+ if (queue_buffer)
+ {
+ if (!queue_buffer->acquired && queue_buffer->dequeued)
+ e_hwc_window_queue_buffer_release(queue, queue_buffer);
+ }
+ }
}
static void
_e_hwc_window_queue_cb_buffer_change(void *data, E_Client *ec)
{
E_Hwc_Window *hwc_window = NULL;
+ E_Comp_Wl_Buffer *comp_buffer;
+ E_Hwc_Window_Queue_Buffer *queue_buffer;
+ uint32_t flags = 0;
+ tbm_surface_h tsurface;
EINA_SAFETY_ON_NULL_RETURN(ec);
hwc_window = ec->hwc_window;
if (!hwc_window) return;
if ((hwc_window->queue) && (e_hwc_window_device_state_available_get(hwc_window)))
+ {
+ if (hwc_window->queue->state == E_HWC_WINDOW_QUEUE_STATE_SET)
+ return;
+
+ comp_buffer = _comp_wl_buffer_get(ec);
+ if (!comp_buffer) return;
+ if (!comp_buffer->resource) return;
+ if (!comp_buffer->tbm_surface) return;
+
+ flags = _comp_wl_buffer_flags_get(comp_buffer);
+ if (flags != E_HWC_WINDOW_QUEUE_BUFFER_FLAGS) return;
+
+ if (e_hwc_window_queue_buffer_find(hwc_window->queue, comp_buffer->tbm_surface))
+ return;
+ }
+
+ if ((ec->exp_iconify.buffer_flush) && (e_policy_visibility_client_is_iconic(ec)))
return;
- _e_hwc_window_queue_backup_buffer_set(hwc_window, EINA_FALSE);
+ tsurface = _e_hwc_window_queue_backup_buffer_set(hwc_window, EINA_FALSE);
+ if (tsurface && hwc_window->queue)
+ {
+ queue_buffer = e_hwc_window_queue_buffer_find(hwc_window->queue, tsurface);
+ if (queue_buffer)
+ {
+ if (!queue_buffer->acquired && queue_buffer->dequeued)
+ e_hwc_window_queue_buffer_release(hwc_window->queue, queue_buffer);
+ }
+ }
}
void