efl_canvas_rectangle: rendering optmization.
authorHermet Park <hermetpark@gmail.com>
Fri, 2 Aug 2019 09:17:40 +0000 (18:17 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 5 Aug 2019 02:51:01 +0000 (11:51 +0900)
commite1c47fa9909834783224e2e5eb610860845e8bae
tree3cd431933fc2d1b3e3fbb491f8542517e6650578
parent32228dd658bda4eecd7629bdabf997702a010400
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);
   }
src/lib/evas/canvas/evas_object_rectangle.c