efl_canvas_rectangle: rendering optmization.

There was a weird profiling result that rectangles drawing is much much slower than images.
Checked reason, the computation rect clip area is the overload point.

I don't think it's necesary but we can simplely improve the performance here
by replacing native function.

I tested this by drawing 400 number of rectangles,
and this patch improved up abt 10 fps(sw), 20fps(gl).

@TEST CODE

   MAX_SIZE = 400;

   for(int i=0; i< MAX_SIZE; i++)
   {
      Evas_Object *rect = evas_object_rectangle_add(layout);

      int x = rand() % WINDOW_WIDTH;
      int y = rand() % WINDOW_HEIGHT;

      evas_object_resize(rect, ELM_SCALE_SIZE(200), ELM_SCALE_SIZE(200));
      evas_object_move(rect, x, y);
      evas_object_color_set(rect, (rand() % 256), (rand() % 256), (rand() % 256), 255);
      evas_object_show(rect);

      Elm_Transit *transit = elm_transit_add();
      elm_transit_object_add(transit, rect);

      int dX = rand() % WINDOW_WIDTH;
      int dY = rand() % WINDOW_HEIGHT;

      elm_transit_effect_translation_add(transit, 0, 0, dX - x, dY - y);
      elm_transit_repeat_times_set(transit, -1);
      elm_transit_duration_set(transit, 1.0);

      elm_transit_go(transit);
   }
This commit is contained in:
Hermet Park 2019-08-02 18:17:40 +09:00
parent 3075bdb648
commit f273d3981c
1 changed files with 5 additions and 9 deletions

View File

@ -234,6 +234,10 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj,
(obj->cur->geometry.w != obj->prev->geometry.w) ||
(obj->cur->geometry.h != obj->prev->geometry.h))
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
//This Performance is not so good ...!
#if 0
evas_rects_return_difference_rects(&obj->layer->evas->clip_changes,
obj->cur->geometry.x,
obj->cur->geometry.y,
@ -243,15 +247,7 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj,
obj->prev->geometry.y,
obj->prev->geometry.w,
obj->prev->geometry.h);
//// rl = evas_rects_return_difference_rects(obj->cur->cache.geometry.x,
//// obj->cur->cache.geometry.y,
//// obj->cur->cache.geometry.w,
//// obj->cur->cache.geometry.h,
//// obj->prev->cache.geometry.x,
//// obj->prev->cache.geometry.y,
//// obj->prev->cache.geometry.w,
//// obj->prev->cache.geometry.h);
goto done;
#endif
}
done:
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);