summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_evas/ecore_evas.c58
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h8
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c14
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c5
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn.c5
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c7
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c5
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c5
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c5
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c5
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c5
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c5
12 files changed, 116 insertions, 11 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index d3e3f28b9c..fa0c8ebe24 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -3070,12 +3070,59 @@ _ecore_evas_fps_debug_rendertime_add(double t)
3070} 3070}
3071 3071
3072EAPI void 3072EAPI void
3073ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport)
3074{
3075 Ecore_Evas *subee;
3076 Eina_List *l;
3077 Efl_Core_Event_Animator_Tick a = { { 0 } };
3078
3079 if (!viewport)
3080 {
3081 evas_output_size_get(ee->evas, &a.update_area.w, &a.update_area.h);
3082 }
3083 else
3084 {
3085 a.update_area = *viewport;
3086 }
3087
3088 eo_do(ee->evas, eo_event_callback_call(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, &a));
3089
3090 // FIXME: We do not support partial animator in the subcanvas
3091 a.update_area.x = 0;
3092 a.update_area.y = 0;
3093 EINA_LIST_FOREACH(ee->sub_ecore_evas, l, subee)
3094 {
3095 evas_output_size_get(subee->evas, &a.update_area.w, &a.update_area.h);
3096 eo_do(subee->evas, eo_event_callback_call(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, &a));
3097 }
3098}
3099
3100static Eina_Bool
3101_ecore_evas_animator_fallback(void *data)
3102{
3103 ecore_evas_animator_tick(data, NULL);
3104 return EINA_TRUE;
3105}
3106
3107EAPI void
3073_ecore_evas_register(Ecore_Evas *ee) 3108_ecore_evas_register(Ecore_Evas *ee)
3074{ 3109{
3075 ee->registered = 1; 3110 ee->registered = 1;
3076 ecore_evases = (Ecore_Evas *)eina_inlist_prepend 3111 ecore_evases = (Ecore_Evas *)eina_inlist_prepend
3077 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee)); 3112 (EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
3078 3113
3114 if (ee->engine.func->fn_animator_register &&
3115 ee->engine.func->fn_animator_unregister)
3116 {
3117 // Backend support per window vsync
3118 ee->engine.func->fn_animator_register(ee);
3119 }
3120 else
3121 {
3122 // Backend doesn't support per window vsync, fallback to generic support
3123 ee->anim = ecore_animator_add(_ecore_evas_animator_fallback, ee);
3124 }
3125
3079#ifdef RENDER_SYNC 3126#ifdef RENDER_SYNC
3080 ecore_evas_first = EINA_TRUE; 3127 ecore_evas_first = EINA_TRUE;
3081#endif 3128#endif
@@ -3107,6 +3154,17 @@ _ecore_evas_free(Ecore_Evas *ee)
3107 ee->deleted = EINA_TRUE; 3154 ee->deleted = EINA_TRUE;
3108 if (ee->refcount > 0) return; 3155 if (ee->refcount > 0) return;
3109 3156
3157 // Stop all vsync first
3158 if (ee->engine.func->fn_animator_register &&
3159 ee->engine.func->fn_animator_unregister)
3160 {
3161 // Backend support per window vsync
3162 ee->engine.func->fn_animator_unregister(ee);
3163 }
3164 if (ee->anim)
3165 ecore_animator_del(ee->anim);
3166 ee->anim = NULL;
3167
3110 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee); 3168 if (ee->func.fn_pre_free) ee->func.fn_pre_free(ee);
3111 while (ee->sub_ecore_evas) 3169 while (ee->sub_ecore_evas)
3112 { 3170 {
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index c342ace7a8..62e5545e7b 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -153,6 +153,9 @@ struct _Ecore_Evas_Engine_Func
153 void (*fn_wm_rot_manual_rotation_done) (Ecore_Evas *ee); 153 void (*fn_wm_rot_manual_rotation_done) (Ecore_Evas *ee);
154 154
155 void (*fn_aux_hints_set) (Ecore_Evas *ee, const char *hints); 155 void (*fn_aux_hints_set) (Ecore_Evas *ee, const char *hints);
156
157 void (*fn_animator_register) (Ecore_Evas *ee);
158 void (*fn_animator_unregister)(Ecore_Evas *ee);
156}; 159};
157 160
158struct _Ecore_Evas_Interface 161struct _Ecore_Evas_Interface
@@ -294,6 +297,9 @@ struct _Ecore_Evas
294 Ecore_Evas_Engine engine; 297 Ecore_Evas_Engine engine;
295 Eina_List *sub_ecore_evas; 298 Eina_List *sub_ecore_evas;
296 299
300 // Animator code
301 Ecore_Animator *anim;
302
297 struct { 303 struct {
298 unsigned char avoid_damage; 304 unsigned char avoid_damage;
299 unsigned char resize_shape : 1; 305 unsigned char resize_shape : 1;
@@ -419,6 +425,8 @@ const Eina_List *_ecore_evas_available_engines_get(void);
419void _ecore_evas_engine_init(void); 425void _ecore_evas_engine_init(void);
420void _ecore_evas_engine_shutdown(void); 426void _ecore_evas_engine_shutdown(void);
421 427
428EAPI void ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport);
429
422#undef EAPI 430#undef EAPI
423#define EAPI 431#define EAPI
424 432
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 0f9c3b6720..054a1e2337 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -643,7 +643,19 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
643 _ecore_evas_screen_geometry_get, 643 _ecore_evas_screen_geometry_get,
644 NULL, // screen_dpi_get 644 NULL, // screen_dpi_get
645 NULL, 645 NULL,
646 NULL // msg_send 646 NULL, // msg_send
647
648 NULL, // fn_pointer_xy_get
649 NULL, // fn_pointer_warp
650
651 NULL, // fn_wm_rot_preferred_rotation_set
652 NULL, // fn_wm_rot_available_rotations_set
653 NULL, // fn_wm_rot_manual_rotation_done_set
654 NULL, // fn_wm_rot_manual_rotation_done
655
656 NULL, // fn_aux_hints_set
657 NULL, // fn_animator_register
658 NULL // fn_animator_unregister
647 }; 659 };
648 660
649static Ecore_Cocoa_Window * 661static Ecore_Cocoa_Window *
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index f25c52c611..63b794978b 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -172,7 +172,10 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
172 NULL, // wm_rot_manual_rotation_done_set 172 NULL, // wm_rot_manual_rotation_done_set
173 NULL, // wm_rot_manual_rotation_done 173 NULL, // wm_rot_manual_rotation_done
174 174
175 NULL // aux_hints_set 175 NULL, // aux_hints_set
176
177 NULL, // fn_animator_register
178 NULL // fn_animator_unregister
176}; 179};
177 180
178EAPI Ecore_Evas * 181EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index c04afe85c1..6cc02b77f8 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -910,7 +910,10 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
910 NULL, // wm_rot_manual_rotation_done_set 910 NULL, // wm_rot_manual_rotation_done_set
911 NULL, // wm_rot_manual_rotation_done 911 NULL, // wm_rot_manual_rotation_done
912 912
913 NULL // aux_hints_set 913 NULL, // aux_hints_set
914
915 NULL, // fn_animator_register
916 NULL // fn_animator_unregister
914}; 917};
915 918
916static Eina_Bool 919static Eina_Bool
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index 8042d0c082..bd34e3ca6f 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -638,8 +638,11 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
638 NULL, // wm_rot_manual_rotation_done_set 638 NULL, // wm_rot_manual_rotation_done_set
639 NULL, // wm_rot_manual_rotation_done 639 NULL, // wm_rot_manual_rotation_done
640 640
641 NULL // aux_hints_set 641 NULL, // aux_hints_set
642 }; 642
643 NULL, // fn_animator_register
644 NULL // fn_animator_unregister
645};
643 646
644EAPI Ecore_Evas * 647EAPI Ecore_Evas *
645ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h) 648ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
index c3232649c5..62350681bf 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -460,7 +460,10 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
460 NULL, // wm_rot_manual_rotation_done_set 460 NULL, // wm_rot_manual_rotation_done_set
461 NULL, // wm_rot_manual_rotation_done 461 NULL, // wm_rot_manual_rotation_done
462 462
463 NULL // aux_hints_set 463 NULL, // aux_hints_set
464
465 NULL, // fn_animator_register
466 NULL // fn_animator_unregister
464}; 467};
465 468
466EAPI Ecore_Evas * 469EAPI Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index 0c14c8957c..1cdcb9af10 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -549,7 +549,10 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
549 NULL, // wm_rot_manual_rotation_done_set 549 NULL, // wm_rot_manual_rotation_done_set
550 NULL, // wm_rot_manual_rotation_done 550 NULL, // wm_rot_manual_rotation_done
551 551
552 NULL // aux_hints_set 552 NULL, // aux_hints_set
553
554 NULL, // fn_animator_register
555 NULL // fn_animator_unregister
553}; 556};
554 557
555static Ecore_Evas* 558static Ecore_Evas*
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index c6def65d9a..46e9e034c2 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -109,7 +109,10 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
109 NULL, // wm_rot_manual_rotation_done_set 109 NULL, // wm_rot_manual_rotation_done_set
110 NULL, // wm_rot_manual_rotation_done 110 NULL, // wm_rot_manual_rotation_done
111 111
112 NULL // aux_hints_set 112 NULL, // aux_hints_set
113
114 NULL, // fn_animator_register
115 NULL // fn_animator_unregister
113}; 116};
114 117
115/* external variables */ 118/* external variables */
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index 23b9b01e1c..1afa86d5cf 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -109,7 +109,10 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
109 NULL, // wm_rot_manual_rotation_done_set 109 NULL, // wm_rot_manual_rotation_done_set
110 NULL, // wm_rot_manual_rotation_done 110 NULL, // wm_rot_manual_rotation_done
111 111
112 NULL // aux_hints_set 112 NULL, // aux_hints_set
113
114 NULL, // fn_animator_register
115 NULL // fn_animator_unregister
113}; 116};
114 117
115/* external variables */ 118/* external variables */
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 38833341a2..a9404ca84f 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -1200,7 +1200,10 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1200 NULL, // wm_rot_manual_rotation_done_set 1200 NULL, // wm_rot_manual_rotation_done_set
1201 NULL, // wm_rot_manual_rotation_done 1201 NULL, // wm_rot_manual_rotation_done
1202 1202
1203 NULL // aux_hints_set 1203 NULL, // aux_hints_set
1204
1205 NULL, // fn_animator_register
1206 NULL // fn_animator_unregister
1204}; 1207};
1205 1208
1206#endif /* BUILD_ECORE_EVAS_WIN32 */ 1209#endif /* BUILD_ECORE_EVAS_WIN32 */
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index a2ce91269e..418cdaa04f 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -3677,7 +3677,10 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
3677 _ecore_evas_x_wm_rot_manual_rotation_done_set, 3677 _ecore_evas_x_wm_rot_manual_rotation_done_set,
3678 _ecore_evas_x_wm_rot_manual_rotation_done, 3678 _ecore_evas_x_wm_rot_manual_rotation_done,
3679 3679
3680 _ecore_evas_x_aux_hints_set 3680 _ecore_evas_x_aux_hints_set,
3681
3682 NULL, // fn_animator_register
3683 NULL // fn_animator_unregister
3681}; 3684};
3682 3685
3683/* 3686/*