} \
while (0)
+#define E_HWC_HOOK_APPEND(list, type, callback, data) \
+ do \
+ { \
+ E_Hwc_Hook *_ch; \
+ _ch = e_hwc_hook_add(type, callback, data); \
+ assert(_ch); \
+ list = eina_list_append(list, _ch); \
+ } \
+ while (0)
+
#define EHWQERR(f, ec, hwc, ehwq, x...) \
do \
{ \
E_Hwc_Window_Queue *queue;
};
+static Eina_List *hwc_window_queue_hwc_hooks = NULL;
static Eina_List *hwc_window_queue_window_hooks = NULL;
static Eina_List *hwc_window_queue_comp_wl_hooks = NULL;
static E_Hwc_Window_Queue_Manager *_hwc_winq_mgr = NULL;
_e_hwc_window_unkown_queue_release(tsurface);
}
-static void
-_e_hwc_window_queue_norender_queue_state_set(E_Hwc *hwc)
-{
- Eina_Iterator *it;
- E_Hwc_Window_Queue *queue;
- E_Hwc_Window_State target_accepted_state;
- E_Hwc_Window *tmp_hwc_window;
- Eina_List *l, *ll;
-
- it = eina_hash_iterator_data_new(_hwc_winq_mgr->hwc_winq_hash);
- if (!it) return;
-
- target_accepted_state = e_hwc_window_accepted_state_get((E_Hwc_Window *)hwc->target_hwc_window);
-
- EINA_ITERATOR_FOREACH(it, queue)
- {
- if (!queue->user) continue;
- if (!queue->user->buffer.tsurface) continue;
- if (queue->state != E_HWC_WINDOW_QUEUE_STATE_SET_WAITING_BUFFER) continue;
-
- if ((queue->is_target) && (target_accepted_state == E_HWC_WINDOW_STATE_DEVICE))
- {
- if (e_hwc_window_queue_buffer_find(queue, queue->user->buffer.tsurface))
- {
- EINA_LIST_FOREACH_SAFE(queue->user_pending_set, l, ll, tmp_hwc_window)
- e_hwc_window_constraints_reset(tmp_hwc_window);
-
- e_hwc_window_constraints_reset(queue->user);
- }
- }
- else
- {
- if (e_hwc_window_queue_buffer_find(queue, queue->user->buffer.tsurface))
- _e_hwc_window_queue_set(queue);
- }
- }
-
- eina_iterator_free(it);
-}
-
void
_e_hwc_window_queue_cb_accepted_state_set(void *data, E_Hwc_Window *hwc_window)
{
queue = hwc_window->queue;
state = e_hwc_window_accepted_state_get(hwc_window);
- if (e_hwc_window_is_target(hwc_window) && e_hwc_norender_get(hwc_window->hwc))
- _e_hwc_window_queue_norender_queue_state_set(hwc_window->hwc);
-
if ((state == E_HWC_WINDOW_STATE_DEVICE))
{
if (e_hwc_window_is_target(hwc_window))
return queue;
}
+static void
+_e_hwc_window_queue_cb_norender_set(void *data, E_Hwc *hwc)
+{
+ Eina_Iterator *it;
+ E_Hwc_Window_Queue *queue;
+ E_Hwc_Window *tmp_hwc_window;
+ Eina_List *l, *ll;
+
+ it = eina_hash_iterator_data_new(_hwc_winq_mgr->hwc_winq_hash);
+ if (!it) return;
+
+ EINA_ITERATOR_FOREACH(it, queue)
+ {
+ if (!queue->user) continue;
+ if (queue->state == E_HWC_WINDOW_QUEUE_STATE_SET) continue;
+
+ EINA_LIST_FOREACH_SAFE(queue->user_pending_set, l, ll, tmp_hwc_window)
+ e_hwc_window_constraints_reset(tmp_hwc_window);
+
+ e_hwc_window_constraints_reset(queue->user);
+ }
+
+ eina_iterator_free(it);
+}
+
EINTERN Eina_Bool
e_hwc_window_queue_init(void)
{
E_LIST_HANDLER_APPEND(_hwc_winq_mgr->event_handlers, E_EVENT_HWC_WINDOW_QUEUE_UNSET,
_e_hwc_window_queue_cb_unset, NULL);
+ E_HWC_HOOK_APPEND(hwc_window_queue_hwc_hooks, E_HWC_HOOK_NORENDER_SET,
+ _e_hwc_window_queue_cb_norender_set, NULL);
E_HWC_WINDOW_HOOK_APPEND(hwc_window_queue_window_hooks, E_HWC_WINDOW_HOOK_ACCEPTED_STATE_SET,
_e_hwc_window_queue_cb_accepted_state_set, NULL);
E_COMP_WL_HOOK_APPEND(hwc_window_queue_comp_wl_hooks, E_COMP_WL_HOOK_BUFFER_CHANGE,
if (!_hwc_winq_mgr) return;
E_FREE_LIST(_hwc_winq_mgr->event_handlers, ecore_event_handler_del);
+ E_FREE_LIST(hwc_window_queue_hwc_hooks, e_hwc_hook_del);
E_FREE_LIST(hwc_window_queue_window_hooks, e_hwc_window_hook_del);
E_FREE_LIST(hwc_window_queue_comp_wl_hooks, e_comp_wl_hook_del);