summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-04-28 13:28:43 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-28 16:11:23 -0700
commitda8efae8c0a3938e08d80e0d5367bb6228107094 (patch)
tree664f4b2329293a03a21a7b491667a9ddd3cb3b73 /src/lib/ecore_evas
parente99bfd7e7dc77bae8a1fdecf2c8fbf2e1bc130fe (diff)
ecore_evas: refactor ecore_evas buffer render logic.
First step into introducing async rendering for ecore_evas buffer.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 4910c072c8..7c381578b0 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -141,7 +141,7 @@ _ecore_evas_buffer_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
141static int 141static int
142_ecore_evas_buffer_render(Ecore_Evas *ee) 142_ecore_evas_buffer_render(Ecore_Evas *ee)
143{ 143{
144 Eina_List *updates = NULL, *l, *ll; 144 Eina_List *updates = NULL, *ll;
145 Ecore_Evas_Engine_Buffer_Data *bdata; 145 Ecore_Evas_Engine_Buffer_Data *bdata;
146 Ecore_Evas *ee2; 146 Ecore_Evas *ee2;
147 int rend = 0; 147 int rend = 0;
@@ -171,15 +171,6 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
171 updates = evas_render_updates(ee->evas); 171 updates = evas_render_updates(ee->evas);
172 bdata->in_render = 0; 172 bdata->in_render = 0;
173 } 173 }
174 if (bdata->image)
175 {
176 Eina_Rectangle *r;
177
178 evas_object_image_data_set(bdata->image, bdata->pixels);
179 EINA_LIST_FOREACH(updates, l, r)
180 evas_object_image_data_update_add(bdata->image,
181 r->x, r->y, r->w, r->h);
182 }
183 if (updates) 174 if (updates)
184 { 175 {
185 evas_render_updates_free(updates); 176 evas_render_updates_free(updates);
@@ -191,6 +182,20 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
191 return updates ? 1 : rend; 182 return updates ? 1 : rend;
192} 183}
193 184
185static void
186_ecore_evas_buffer_update_image(void *data, Evas *e EINA_UNUSED, void *event_info)
187{
188 Evas_Event_Render_Post *post = event_info;
189 Ecore_Evas_Engine_Buffer_Data *bdata = data;
190 Eina_Rectangle *r;
191 Eina_List *l;
192
193 evas_object_image_data_set(bdata->image, bdata->pixels);
194 EINA_LIST_FOREACH(post->updated_area, l, r)
195 evas_object_image_data_update_add(bdata->image,
196 r->x, r->y, r->w, r->h);
197}
198
194EAPI int 199EAPI int
195ecore_evas_buffer_render(Ecore_Evas *ee) 200ecore_evas_buffer_render(Ecore_Evas *ee)
196{ 201{
@@ -930,6 +935,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
930 evas_output_method_set(ee->evas, rmethod); 935 evas_output_method_set(ee->evas, rmethod);
931 evas_output_size_set(ee->evas, w, h); 936 evas_output_size_set(ee->evas, w, h);
932 evas_output_viewport_set(ee->evas, 0, 0, w, h); 937 evas_output_viewport_set(ee->evas, 0, 0, w, h);
938 evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST, _ecore_evas_buffer_update_image, bdata);
933 939
934 bdata->image = o; 940 bdata->image = o;
935 evas_object_data_set(bdata->image, "Ecore_Evas", ee); 941 evas_object_data_set(bdata->image, "Ecore_Evas", ee);