summaryrefslogtreecommitdiff
path: root/src/lib/ector/software/ector_renderer_software_gradient_linear.c
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-09-17 11:46:09 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-09-17 11:49:48 -0700
commit39fdfc3cac94746c9943cac04c99314d1b0b95a3 (patch)
treeefe8c497a6ee12cac5d318f59d8029c2b709daf3 /src/lib/ector/software/ector_renderer_software_gradient_linear.c
parente380ddb742384546ad05a5f8f5472ecdce795538 (diff)
ector: move gradient color computation to a pool of thread.
This has been a long standing plan for improving performance in rendering vector object. If your test involve updating gradient, you will get another speedup of around 15%. Combined with previous shape, we get a 65% improvement with doing the CPU intensive computation in there own thread before the rendering kickoff. This was motly theorical until now, but well, it works great !
Diffstat (limited to 'src/lib/ector/software/ector_renderer_software_gradient_linear.c')
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_linear.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_linear.c b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
index 4bd4806b28..f024594ea2 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_linear.c
+++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
@@ -11,7 +11,7 @@
11 11
12static Eina_Bool 12static Eina_Bool
13_ector_renderer_software_gradient_linear_ector_renderer_prepare(Eo *obj, 13_ector_renderer_software_gradient_linear_ector_renderer_prepare(Eo *obj,
14 Ector_Renderer_Software_Gradient_Data *pd) 14 Ector_Renderer_Software_Gradient_Data *pd)
15{ 15{
16 if (!pd->surface) 16 if (!pd->surface)
17 { 17 {
@@ -21,7 +21,7 @@ _ector_renderer_software_gradient_linear_ector_renderer_prepare(Eo *obj,
21 pd->surface = efl_data_xref(base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj); 21 pd->surface = efl_data_xref(base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
22 } 22 }
23 23
24 update_color_table(pd); 24 ector_software_gradient_color_update(pd);
25 25
26 pd->linear.x1 = pd->gld->start.x; 26 pd->linear.x1 = pd->gld->start.x;
27 pd->linear.y1 = pd->gld->start.y; 27 pd->linear.y1 = pd->gld->start.y;
@@ -46,19 +46,19 @@ _ector_renderer_software_gradient_linear_ector_renderer_prepare(Eo *obj,
46 46
47static Eina_Bool 47static Eina_Bool
48_ector_renderer_software_gradient_linear_ector_renderer_draw(Eo *obj EINA_UNUSED, 48_ector_renderer_software_gradient_linear_ector_renderer_draw(Eo *obj EINA_UNUSED,
49 Ector_Renderer_Software_Gradient_Data *pd EINA_UNUSED, 49 Ector_Renderer_Software_Gradient_Data *pd EINA_UNUSED,
50 Efl_Gfx_Render_Op op EINA_UNUSED, Eina_Array *clips EINA_UNUSED, 50 Efl_Gfx_Render_Op op EINA_UNUSED, Eina_Array *clips EINA_UNUSED,
51 unsigned int mul_col EINA_UNUSED) 51 unsigned int mul_col EINA_UNUSED)
52{ 52{
53 return EINA_TRUE; 53 return EINA_TRUE;
54} 54}
55 55
56static Eina_Bool 56static Eina_Bool
57_ector_renderer_software_gradient_linear_ector_renderer_software_fill(Eo *obj EINA_UNUSED, 57_ector_renderer_software_gradient_linear_ector_renderer_software_fill(Eo *obj EINA_UNUSED,
58 Ector_Renderer_Software_Gradient_Data *pd) 58 Ector_Renderer_Software_Gradient_Data *pd)
59{ 59{
60 ector_software_rasterizer_linear_gradient_set(pd->surface->rasterizer, pd); 60 ector_software_rasterizer_linear_gradient_set(pd->surface->rasterizer, pd);
61 61 ector_software_gradient_color_update(pd);
62 return EINA_TRUE; 62 return EINA_TRUE;
63} 63}
64 64
@@ -71,6 +71,7 @@ _ector_renderer_software_gradient_linear_efl_object_constructor(Eo *obj,
71 71
72 pd->gd = efl_data_xref(obj, ECTOR_RENDERER_GRADIENT_MIXIN, obj); 72 pd->gd = efl_data_xref(obj, ECTOR_RENDERER_GRADIENT_MIXIN, obj);
73 pd->gld = efl_data_xref(obj, ECTOR_RENDERER_GRADIENT_LINEAR_MIXIN, obj); 73 pd->gld = efl_data_xref(obj, ECTOR_RENDERER_GRADIENT_LINEAR_MIXIN, obj);
74 pd->done = EINA_TRUE;
74 75
75 return obj; 76 return obj;
76} 77}