_e_comp_screen_new(void)
{
E_Comp_Screen *e_comp_screen = NULL;
- int screen_rotation;
e_comp_screen = E_NEW(E_Comp_Screen, 1);
- if (!e_comp_screen) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, EINA_FALSE);
e_comp_screen_set(e_comp_screen);
- /* check the screen rotation */
- screen_rotation = (e_config->screen_rotation_pre + e_config->screen_rotation_setting) % 360;
-
- ELOGF("COMP_SCREEN","screen_rotation_pre %d and screen_rotation_setting %d",
- NULL, e_config->screen_rotation_pre, e_config->screen_rotation_setting);
-
- e_comp_screen->rotation_pre = e_config->screen_rotation_pre;
- e_comp_screen->rotation_setting = e_config->screen_rotation_setting;
- e_comp_screen->rotation = screen_rotation;
-
- e_main_ts_begin("\te_display_init");
-
- if (!e_display_init())
- {
- e_main_ts_end("\te_display_init() failed.");
- ERR("e_display_init failed");
- free(e_comp_screen);
- e_comp_screen_set(NULL);
- return NULL;
- }
-
- e_main_ts_end("\te_display_init Done");
-
- e_comp_screen->num_outputs = e_display_num_outputs_get();
- e_comp_screen->outputs = e_display_outputs_get();
-
- if (e_comp_hwc_is_configured() && e_comp_conf_hwc_deactive_get())
- e_comp_hwc_deactive_set(EINA_TRUE);
-
- /* tbm bufmgr init */
- e_main_ts_begin("\tTBM Bufmgr Server Init");
- e_comp_screen->bufmgr = tbm_bufmgr_server_init();
- if (!e_comp_screen->bufmgr)
- {
- e_main_ts_end("\tTBM Bufmgr Server Init Failed");
- ERR("tbm_bufmgr_init failed\n");
- goto fail;
- }
- e_main_ts_end("\tTBM Bufmgr Server Init Done");
-
return e_comp_screen;
-
-fail:
- if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr);
-
- free(e_comp_screen);
- e_comp_screen_set(NULL);
- TRACE_DS_END();
-
- return NULL;
}
static void
_e_comp_screen_del(E_Comp_Screen *e_comp_screen)
{
- if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr);
+ if (!e_comp_screen) return;
free(e_comp_screen);
}
E_Comp_Wl_Data *comp_wl;
E_Comp_Screen *e_comp_screen;
int w, h, ptr_x = 0, ptr_y = 0;
+ int screen_rotation;
E_EVENT_SCREEN_CHANGE = ecore_event_type_new();
}
e_main_ts_end("\tE_Comp_Screen New Done");
+ /* check the screen rotation */
+ screen_rotation = (e_config->screen_rotation_pre + e_config->screen_rotation_setting) % 360;
+
+ ELOGF("COMP_SCREEN","screen_rotation_pre %d and screen_rotation_setting %d",
+ NULL, e_config->screen_rotation_pre, e_config->screen_rotation_setting);
+
+ e_comp_screen->rotation_pre = e_config->screen_rotation_pre;
+ e_comp_screen->rotation_setting = e_config->screen_rotation_setting;
+ e_comp_screen->rotation = screen_rotation;
+
+ e_main_ts_begin("\te_display_init");
+ if (!e_display_init())
+ {
+ e_main_ts_end("\te_display_init() failed.");
+ ERR("e_display_init failed");
+ goto failed_comp_screen;
+ }
+ e_main_ts_end("\te_display_init Done");
+
+ e_comp_screen->num_outputs = e_display_num_outputs_get();
+ e_comp_screen->outputs = e_display_outputs_get();
+
+ if (e_comp_hwc_is_configured() && e_comp_conf_hwc_deactive_get())
+ e_comp_hwc_deactive_set(EINA_TRUE);
+
+ /* tbm bufmgr init */
+ e_main_ts_begin("\tTBM Bufmgr Server Init");
+ e_comp_screen->bufmgr = tbm_bufmgr_server_init();
+ if (!e_comp_screen->bufmgr)
+ {
+ e_main_ts_end("\tTBM Bufmgr Server Init Failed");
+ ERR("tbm_bufmgr_init failed\n");
+ goto failed_comp_screen;
+ }
+ e_main_ts_end("\tTBM Bufmgr Server Init Done");
+
+
ecore_event_add(E_EVENT_SCREEN_CHANGE, NULL, NULL, NULL);
e_comp_screen_e_screens_setup(e_comp_screen, -1, -1);
failed_comp_screen:
e_input_shutdown();
+ if (e_comp_screen->bufmgr) tbm_bufmgr_deinit(e_comp_screen->bufmgr);
_e_comp_screen_del(e_comp_screen);
- e_comp_screen_set(NULL);
return EINA_FALSE;
}