From: Changyeon Lee Date: Fri, 18 Oct 2019 05:50:01 +0000 (+0900) Subject: e_hwc: add E_EVENT_HWC_ACTIVE/DEACTIVE event X-Git-Tag: submit/tizen/20191021.062138^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=928aa1829a42f206d0b7bdaa5f8c48769dda6f45;p=platform%2Fupstream%2Fenlightenment.git e_hwc: add E_EVENT_HWC_ACTIVE/DEACTIVE event Change-Id: I93d7c35abf68453008f23800c869b1b239c83bd6 --- diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 721d5a90a7..18190aae00 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -653,6 +653,7 @@ _e_comp_screen_deinit_outputs(E_Comp_Screen *e_comp_screen) e_output_del(output); } + e_hwc_deinit(); e_hwc_windows_deinit(); e_hwc_planes_deinit(); e_output_shutdown(); @@ -707,6 +708,12 @@ _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen) ELOGF("COMP_SCREEN","num_outputs = %i", NULL, e_comp_screen->num_outputs); + if (!e_hwc_init()) + { + ERR("e_hwc_init failed"); + goto fail; + } + if (!e_hwc_planes_init()) { ERR("e_hwc_planes_init failed"); diff --git a/src/bin/e_hwc.c b/src/bin/e_hwc.c index 261bbea976..057c3edcd1 100644 --- a/src/bin/e_hwc.c +++ b/src/bin/e_hwc.c @@ -17,6 +17,9 @@ } \ while (0) +E_API int E_EVENT_HWC_ACTIVE = -1; +E_API int E_EVENT_HWC_DEACTIVE = -1; + static int _e_hwc_intercept_hooks_delete = 0; static int _e_hwc_intercept_hooks_walking = 0; @@ -326,6 +329,20 @@ _e_hwc_ee_init(E_Hwc* hwc) return EINA_TRUE; } +EINTERN Eina_Bool +e_hwc_init(void) +{ + E_EVENT_HWC_ACTIVE = ecore_event_type_new(); + E_EVENT_HWC_DEACTIVE = ecore_event_type_new(); + + return EINA_TRUE; +} + +EINTERN void +e_hwc_deinit(void) +{ +} + EINTERN E_Hwc * e_hwc_new(E_Output *output, Eina_Bool primary_output) { @@ -403,6 +420,9 @@ e_hwc_new(E_Output *output, Eina_Bool primary_output) } } + /* default active hwc */ + ecore_event_add(E_EVENT_HWC_ACTIVE, NULL, NULL, NULL); + return hwc; fail: @@ -448,11 +468,18 @@ e_hwc_deactive_set(E_Hwc *hwc, Eina_Bool set) { EINA_SAFETY_ON_NULL_RETURN(hwc); + if (hwc->hwc_deactive == set) return; + if (e_hwc_policy_get(hwc) == E_HWC_POLICY_PLANES) e_hwc_planes_end(hwc, __FUNCTION__); hwc->hwc_deactive = set; + if (set) + ecore_event_add(E_EVENT_HWC_DEACTIVE, NULL, NULL, NULL); + else + ecore_event_add(E_EVENT_HWC_ACTIVE, NULL, NULL, NULL); + EHINF("e_hwc_deactive_set : %d", hwc, set); } diff --git a/src/bin/e_hwc.h b/src/bin/e_hwc.h index 905f73476c..2e4622ac30 100644 --- a/src/bin/e_hwc.h +++ b/src/bin/e_hwc.h @@ -140,6 +140,12 @@ struct _E_Hwc int flapse; }; +E_API extern int E_EVENT_HWC_ACTIVE; +E_API extern int E_EVENT_HWC_DEACTIVE; + +EINTERN Eina_Bool e_hwc_init(void); +EINTERN void e_hwc_deinit(void); + EINTERN E_Hwc *e_hwc_new(E_Output *output, Eina_Bool primary_output); EINTERN void e_hwc_del(E_Hwc *hwc); EINTERN E_Hwc_Mode e_hwc_mode_get(E_Hwc *hwc);