hwc_window->hwc = hwc;
hwc_window->ec = ec;
hwc_window->state = state;
+ hwc_window->render_target = EINA_TRUE;
hwc_window->thwc_window = tdm_hwc_create_window(thwc, &error);
if (error != TDM_ERROR_NONE)
}
+static void
+_e_hwc_window_client_recover(E_Hwc_Window *hwc_window)
+{
+ E_Comp_Wl_Buffer *buffer = NULL, *recover_buffer = NULL;;
+ tbm_surface_h tsurface =NULL;
+ E_Client *ec = NULL;
+
+ ec = hwc_window->ec;
+ EINA_SAFETY_ON_NULL_RETURN(ec);
+
+ buffer = _e_hwc_window_comp_wl_buffer_get(hwc_window);
+ if (!buffer)
+ {
+ tsurface = e_hwc_window_displaying_surface_get(hwc_window);
+ if (!tsurface) return;
+
+ recover_buffer = e_comp_wl_tbm_buffer_get(tsurface);
+ }
+ else
+ recover_buffer = buffer;
+
+
+ EINA_SAFETY_ON_NULL_RETURN(recover_buffer);
+
+ EHWTRACE("Recover ts:%p -- {%s}",
+ hwc_window->ec, hwc_window, recover_buffer->tbm_surface,
+ e_hwc_window_name_get(hwc_window));
+
+ /* force update */
+ e_comp_wl_surface_attach(ec, recover_buffer);
+
+ return;
+}
+
+EINTERN Eina_Bool
+e_hwc_window_render_target_window_set(E_Hwc_Window *hwc_window, Eina_Bool set)
+{
+ E_Client *ec = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+
+ ec = hwc_window->ec;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+
+ if (hwc_window->render_target == set) return EINA_TRUE;
+
+ if (set)
+ {
+ _e_hwc_window_client_recover(hwc_window);
+
+ if (hwc_window->need_redirect)
+ {
+ 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_client_redirected_set(ec, EINA_TRUE);
+ hwc_window->need_redirect = EINA_FALSE;
+
+ EHWTRACE("Redirect -- {%s}",
+ hwc_window->ec, hwc_window, e_hwc_window_name_get(hwc_window));
+ }
+ }
+ else
+ {
+ if (hwc_window->ec->redirected)
+ {
+ e_client_redirected_set(hwc_window->ec, EINA_FALSE);
+ hwc_window->need_redirect = EINA_TRUE;
+
+ EHWTRACE("Unredirect -- {%s}",
+ hwc_window->ec, hwc_window, e_hwc_window_name_get(hwc_window));
+ }
+ }
+
+ hwc_window->render_target = set;
+
+ return EINA_TRUE;
+}
+
EINTERN const char*
e_hwc_window_state_string_get(E_Hwc_Window_State hwc_window_state)
{
E_Hwc_Window_Queue *queue;
struct wl_listener queue_destroy_listener;
- Eina_Bool is_device_to_client_transition;
+ Eina_Bool render_target;
+ Eina_Bool need_redirect;
};
struct _E_Hwc_Window_Target
EINTERN E_Hwc_Window_State e_hwc_window_accepted_state_get(E_Hwc_Window *hwc_window);
EINTERN void e_hwc_window_render_list_add(E_Hwc_Window *hwc_window);
-
EINTERN Eina_Bool e_hwc_window_is_on_target_window(E_Hwc_Window *hwc_window);
+EINTERN Eina_Bool e_hwc_window_render_target_window_set(E_Hwc_Window *hwc_window, Eina_Bool set);
EINTERN const char *e_hwc_window_state_string_get(E_Hwc_Window_State hwc_window_state);
EINTERN const char *e_hwc_window_name_get(E_Hwc_Window *hwc_window);
}
}
+static void
+_e_hwc_windows_render_target_update(E_Hwc *hwc)
+{
+ E_Hwc_Window *hwc_window = NULL;
+ const Eina_List *l = NULL;
+ E_Hwc_Window_State state;
+ E_Pointer *pointer = NULL;
+
+ EINA_LIST_FOREACH(e_hwc_windows_get(hwc), l, hwc_window)
+ {
+ if (hwc_window->is_target) continue;
+ if (!hwc_window->ec) continue;
+
+ state = e_hwc_window_state_get(hwc_window);
+
+ if (hwc_window->is_cursor)
+ pointer = e_pointer_get(hwc_window->ec);
+
+ switch(state)
+ {
+ case E_HWC_WINDOW_STATE_DEVICE:
+ case E_HWC_WINDOW_STATE_CURSOR:
+ e_hwc_window_render_target_window_set(hwc_window, EINA_FALSE);
+ if (pointer)
+ e_pointer_hwc_set(pointer, EINA_TRUE);
+ break;
+ case E_HWC_WINDOW_STATE_CLIENT:
+ case E_HWC_WINDOW_STATE_NONE:
+ e_hwc_window_render_target_window_set(hwc_window, EINA_TRUE);
+ if (pointer)
+ e_pointer_hwc_set(pointer, EINA_FALSE);
+ break;
+ case E_HWC_WINDOW_STATE_VIDEO:
+ default:
+ break;
+ }
+ }
+}
+
static Eina_Bool
_e_hwc_windows_accept(E_Hwc *hwc, uint32_t num_changes)
{
e_hwc_window_state_set(hwc_window, state);
}
+ _e_hwc_windows_render_target_update(hwc);
+
#if DBG_EVALUATE
EHWSTRACE(" Modified after HWC Validation:", NULL);
_e_hwc_windows_status_print(hwc, EINA_FALSE);