return PEPPER_TRUE;
}
-// check the changes of the visible_window_list on hwc
+// check the changes of the curr_vwin_list on hwc
// check chagnes below
// - number of visible windows
// - windows stack
// - remove a window on the list
// - change the order of windows : window stack
static pepper_bool_t
-__hwc_check_changes_visible_window_list(pepper_tdm_hwc_t *hwc,
- pepper_list_t *visible_window_list,
- unsigned int num_visible_wins)
+__hwc_check_changes_curr_vwin_list(pepper_tdm_hwc_t *hwc,
+ pepper_list_t *candidate_vwin_list,
+ unsigned int num_vwins)
{
pepper_list_t *prev_list;
pepper_list_t *curr_list;
unsigned int i, cnt;
// first time
- if (!hwc->visible_window_list)
+ if (!hwc->curr_vwin_list)
return PEPPER_TRUE;
- prev_list = hwc->visible_window_list;
- curr_list = visible_window_list;
+ prev_list = hwc->curr_vwin_list;
+ curr_list = candidate_vwin_list;
- if (hwc->num_visible_wins != num_visible_wins)
+ if (hwc->num_vwins != num_vwins)
return PEPPER_TRUE;
- for (i = 0; i < num_visible_wins; i++) {
+ for (i = 0; i < num_vwins; i++) {
cnt = 0;
pepper_list_for_each_safe(hwc_window1, tmp, prev_list, link)
if (i == cnt++) break;
}
static void
-__hwc_visible_window_list_destory(pepper_list_t *visible_window_list)
+__hwc_candidate_vwins_list_destory(pepper_list_t *candidate_vwin_list)
{
- pepper_tdm_hwc_window_t *hwc_window, *tmp;
-
- if (!visible_window_list)
+ if (!candidate_vwin_list)
return;
- pepper_list_for_each_safe(hwc_window, tmp, visible_window_list, visible_window_link)
- pepper_list_remove(&hwc_window->visible_window_link);
-
- free(visible_window_list);
+ free(candidate_vwin_list);
}
// create a visible window list with a view list
static pepper_list_t *
-__hwc_create_visible_window_list(pepper_tdm_hwc_t *hwc,
+__hwc_create_candidate_vwin_list(pepper_tdm_hwc_t *hwc,
const pepper_list_t *view_list,
- unsigned int *num_visible_wins)
+ unsigned int *num_vwins)
{
- pepper_list_t *visible_window_list, *l;
+ pepper_list_t *candidate_vwin_list, *l;
pepper_view_t *view;
pepper_surface_t *surface;
pepper_tdm_hwc_window_t *hwc_window, *hwc_window2;
- visible_window_list = calloc(1, sizeof(pepper_list_t));
- if (!visible_window_list)
+ candidate_vwin_list = calloc(1, sizeof(pepper_list_t));
+ if (!candidate_vwin_list)
return NULL;
- pepper_list_init(visible_window_list);
+ pepper_list_init(candidate_vwin_list);
- // make a visible_window_list
+ // make a candidate_vwin_list
// TODO: CHECK Point..
// does not add hwc_window to the visible window list
// when a pepper_view does not have a pepper_surface because
PEPPER_INFO("surface:%p view:%p hwc_window:%p thwc_window:%p.\n",
surface, view, hwc_window, hwc_window->thwc_window);
- pepper_list_insert(visible_window_list, &hwc_window->visible_window_link);
- ++(*num_visible_wins);
+ pepper_list_insert(candidate_vwin_list, &hwc_window->candidate_vwin_link);
+ ++(*num_vwins);
}
- PEPPER_INFO("num_visible_wins curr:%d, necxt:%d\n", hwc->num_visible_wins, num_visible_wins);
+ PEPPER_INFO("num_vwins curr:%d, necxt:%d\n", hwc->num_vwins, num_vwins);
- return visible_window_list;
+ return candidate_vwin_list;
}
// change the visible window list on hwc with the given visible window list
static void
-__hwc_change_visible_window_list(pepper_tdm_hwc_t *hwc, pepper_list_t *visible_window_list,
- unsigned int num_visible_wins)
+__hwc_replace_curr_vwin_list(pepper_tdm_hwc_t *hwc, pepper_list_t *candidate_vwin_list,
+ unsigned int num_vwins)
{
- __hwc_visible_window_list_destory(hwc->visible_window_list);
+ pepper_tdm_hwc_window_t *hwc_window;
+
+ // remove the current visible window list
+ free(hwc->curr_vwin_list);
- hwc->num_visible_wins = num_visible_wins;
- hwc->visible_window_list = visible_window_list;
+ // set the candidate visible window list as a current visible window list
+ hwc->num_vwins = num_vwins;
+ hwc->curr_vwin_list = candidate_vwin_list;
}
// update the visible window list on hwc with the given visible view list
static pepper_bool_t
-__hwc_update_visible_window_list(pepper_tdm_hwc_t *hwc, const pepper_list_t *view_list)
+__hwc_update_curr_vwin_list(pepper_tdm_hwc_t *hwc, const pepper_list_t *view_list)
{
- pepper_list_t *visible_window_list;
- unsigned int num_visible_wins = 0;
+ pepper_list_t *candidate_vwin_list;
+ unsigned int num_vwins = 0;
// get a visible hwc window list from view list
- visible_window_list = __hwc_create_visible_window_list(hwc, view_list, &num_visible_wins);
- if (!visible_window_list)
+ candidate_vwin_list = __hwc_create_candidate_vwin_list(hwc, view_list, &num_vwins);
+ if (!candidate_vwin_list)
return PEPPER_FALSE;
// check the changes of the visible windows
- if (!__hwc_check_changes_visible_window_list(hwc, visible_window_list, num_visible_wins)) {
- __hwc_visible_window_list_destory(visible_window_list);
+ if (!__hwc_check_changes_curr_vwin_list(hwc, candidate_vwin_list, num_vwins)) {
+ __hwc_candidate_vwins_list_destory(candidate_vwin_list);
return PEPPER_FALSE;
}
- __hwc_change_visible_window_list(hwc, visible_window_list, num_visible_wins);
+ __hwc_replace_curr_vwin_list(hwc, candidate_vwin_list, num_vwins);
return PEPPER_TRUE;
}
PEPPER_INFO("\n");
- changed = __hwc_update_visible_window_list(hwc, view_list);
+ changed = __hwc_update_curr_vwin_list(hwc, view_list);
pepper_list_for_each(hwc_window, &hwc->window_list, link) {
PEPPER_INFO("hwc_window:%p thwc_window:%p\n", hwc_window, hwc_window->thwc_window);
// set the composition types of visible windows
// TODO: all gl composite... for verifiying .
if (changed) {
- pepper_list_for_each(hwc_window, hwc->visible_window_list, visible_window_link)
+ pepper_list_for_each(hwc_window, hwc->curr_vwin_list, curr_vwin_link)
__hwc_window_update_composition_type(hwc_window, TDM_HWC_WIN_COMPOSITION_CLIENT);
}
uint32_t i, n_thw, num_changes;
pepper_bool_t ret;
- n_thw = hwc->num_visible_wins;
+ n_thw = hwc->num_vwins;
if (n_thw) {
thwc_windows = calloc(n_thw, sizeof(tdm_hwc_window *));
PEPPER_CHECK(thwc_windows, return PEPPER_FALSE, "thwc_window allocation failed.\n");
i = 0;
- pepper_list_for_each(hwc_window, hwc->visible_window_list, visible_window_link) {
+ pepper_list_for_each(hwc_window, hwc->curr_vwin_list, curr_vwin_link) {
PEPPER_INFO("[%d] hwc_window:%p thwc_window:%p\n", i, hwc_window, hwc_window->thwc_window);
thwc_windows[i++] = hwc_window->thwc_window;
}