summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-10-01 15:35:09 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-10-04 18:26:57 -0300
commitd1c6266c45b6bfbfbba4a3b61ee6e9e5cec99cc9 (patch)
tree3fd9297add75125953ab1e45747bdcc5c99cffc2 /src
parent22f9a6e8f004ab3e4aaf214229e4556482040f29 (diff)
evas/image: Delay some video overlay operations.
If we are running on async render, some operations must be delayed, so they will happen at the same time that the canvas rendering result gets updated on the window/surface.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c53
-rw-r--r--src/lib/evas/canvas/evas_render.c10
-rw-r--r--src/lib/evas/include/evas_private.h1
3 files changed, 57 insertions, 7 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 8020466a0c..af76f53fc2 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -126,6 +126,13 @@ struct _Evas_Object_Image
126 Eina_Bool proxy_src_clip : 1; 126 Eina_Bool proxy_src_clip : 1;
127 Eina_Bool written : 1; 127 Eina_Bool written : 1;
128 Eina_Bool direct_render : 1; 128 Eina_Bool direct_render : 1;
129 struct
130 {
131 Eina_Bool video_move : 1;
132 Eina_Bool video_resize : 1;
133 Eina_Bool video_show : 1;
134 Eina_Bool video_hide : 1;
135 } delayed;
129}; 136};
130 137
131/* private methods for image objects */ 138/* private methods for image objects */
@@ -5213,21 +5220,21 @@ _evas_object_image_video_overlay_show(Evas_Object *eo_obj)
5213{ 5220{
5214 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); 5221 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
5215 Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); 5222 Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS);
5216 Evas_Public_Data *e = obj->layer->evas;
5217 5223
5218 if (obj->cur->cache.clip.x != obj->prev->cache.clip.x || 5224 if (obj->cur->cache.clip.x != obj->prev->cache.clip.x ||
5219 obj->cur->cache.clip.y != obj->prev->cache.clip.y || 5225 obj->cur->cache.clip.y != obj->prev->cache.clip.y ||
5220 o->created || !o->video_visible) 5226 o->created || !o->video_visible)
5221 o->pixels->video.move(o->pixels->video.data, eo_obj, &o->pixels->video, 5227 o->delayed.video_move = EINA_TRUE;
5222 obj->cur->cache.clip.x + e->framespace.x, 5228
5223 obj->cur->cache.clip.y + e->framespace.y);
5224 if (obj->cur->cache.clip.w != obj->prev->cache.clip.w || 5229 if (obj->cur->cache.clip.w != obj->prev->cache.clip.w ||
5225 obj->cur->cache.clip.h != obj->prev->cache.clip.h || 5230 obj->cur->cache.clip.h != obj->prev->cache.clip.h ||
5226 o->created || !o->video_visible) 5231 o->created || !o->video_visible)
5227 o->pixels->video.resize(o->pixels->video.data, eo_obj, &o->pixels->video, obj->cur->cache.clip.w, obj->cur->cache.clip.h); 5232 o->delayed.video_resize = EINA_TRUE;
5233
5228 if (!o->video_visible || o->created) 5234 if (!o->video_visible || o->created)
5229 { 5235 {
5230 o->pixels->video.show(o->pixels->video.data, eo_obj, &o->pixels->video); 5236 o->delayed.video_show = EINA_TRUE;
5237 o->delayed.video_hide = EINA_FALSE;
5231 } 5238 }
5232 else 5239 else
5233 { 5240 {
@@ -5254,13 +5261,45 @@ _evas_object_image_video_overlay_hide(Evas_Object *eo_obj)
5254 Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS); 5261 Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS);
5255 5262
5256 if (o->video_visible || o->created) 5263 if (o->video_visible || o->created)
5257 o->pixels->video.hide(o->pixels->video.data, eo_obj, &o->pixels->video); 5264 {
5265 o->delayed.video_hide = EINA_TRUE;
5266 o->delayed.video_show = EINA_FALSE;
5267 }
5258 if (evas_object_is_visible(eo_obj, obj)) 5268 if (evas_object_is_visible(eo_obj, obj))
5259 o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video); 5269 o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video);
5260 o->video_visible = EINA_FALSE; 5270 o->video_visible = EINA_FALSE;
5261 o->created = EINA_FALSE; 5271 o->created = EINA_FALSE;
5262} 5272}
5263 5273
5274void
5275_evas_object_image_video_overlay_do(Evas_Object *eo_obj)
5276{
5277 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
5278 Evas_Object_Image *o = eo_data_scope_get(eo_obj, MY_CLASS);
5279 Evas_Public_Data *e = obj->layer->evas;
5280
5281 if (o->delayed.video_move)
5282 o->pixels->video.move(o->pixels->video.data, eo_obj, &o->pixels->video,
5283 obj->cur->cache.clip.x + e->framespace.x,
5284 obj->cur->cache.clip.y + e->framespace.y);
5285
5286 if (o->delayed.video_resize)
5287 o->pixels->video.resize(o->pixels->video.data, eo_obj,
5288 &o->pixels->video,
5289 obj->cur->cache.clip.w,
5290 obj->cur->cache.clip.h);
5291
5292 if (o->delayed.video_show)
5293 o->pixels->video.show(o->pixels->video.data, eo_obj, &o->pixels->video);
5294 else if (o->delayed.video_hide)
5295 o->pixels->video.hide(o->pixels->video.data, eo_obj, &o->pixels->video);
5296
5297 o->delayed.video_move = EINA_FALSE;
5298 o->delayed.video_resize = EINA_FALSE;
5299 o->delayed.video_show = EINA_FALSE;
5300 o->delayed.video_hide = EINA_FALSE;
5301}
5302
5264static void 5303static void
5265_class_constructor(Eo_Class *klass) 5304_class_constructor(Eo_Class *klass)
5266{ 5305{
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 670c146d0d..49fbefefe8 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1896,6 +1896,10 @@ evas_render_updates_internal(Evas *eo_e,
1896 } 1896 }
1897 else if (haveup) 1897 else if (haveup)
1898 { 1898 {
1899 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
1900 {
1901 _evas_object_image_video_overlay_do(eo_obj);
1902 }
1899 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); 1903 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
1900 e->engine.func->output_flush(e->engine.data.output, 1904 e->engine.func->output_flush(e->engine.data.output,
1901 EVAS_RENDER_MODE_SYNC); 1905 EVAS_RENDER_MODE_SYNC);
@@ -2085,6 +2089,12 @@ evas_render_wakeup(Evas *eo_e)
2085 /* flush redraws */ 2089 /* flush redraws */
2086 if (haveup) 2090 if (haveup)
2087 { 2091 {
2092 Eina_List *ll;
2093 Evas_Object *eo_obj;
2094 EINA_LIST_FOREACH(e->video_objects, ll, eo_obj)
2095 {
2096 _evas_object_image_video_overlay_do(eo_obj);
2097 }
2088 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); 2098 evas_event_callback_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
2089 e->engine.func->output_flush(e->engine.data.output, 2099 e->engine.func->output_flush(e->engine.data.output,
2090 EVAS_RENDER_MODE_ASYNC_END); 2100 EVAS_RENDER_MODE_ASYNC_END);
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 5a9867b120..01658f7b97 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -996,6 +996,7 @@ void _evas_object_image_preloading_check(Evas_Object *obj);
996Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj); 996Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
997void _evas_object_image_video_overlay_show(Evas_Object *obj); 997void _evas_object_image_video_overlay_show(Evas_Object *obj);
998void _evas_object_image_video_overlay_hide(Evas_Object *obj); 998void _evas_object_image_video_overlay_hide(Evas_Object *obj);
999void _evas_object_image_video_overlay_do(Evas_Object *obj);
999void _evas_object_image_free(Evas_Object *obj); 1000void _evas_object_image_free(Evas_Object *obj);
1000void evas_object_smart_bounding_box_get(Evas_Object *eo_obj, 1001void evas_object_smart_bounding_box_get(Evas_Object *eo_obj,
1001 Evas_Coord_Rectangle *cur_bounding_box, 1002 Evas_Coord_Rectangle *cur_bounding_box,