summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-09-16 23:19:35 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-09-17 11:49:48 -0700
commit560e5c8e0f071d2cbaec0649bc1e8100d9e7f82e (patch)
tree36bddfedfd5ea62d7aa216447945706321ff8c14 /src/lib
parentdd297854d13832b275f9d709cdbf0b2ff359e0a8 (diff)
ector: avoid calling function pointer when it is unecessary.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ector/software/ector_software_gradient.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/ector/software/ector_software_gradient.c b/src/lib/ector/software/ector_software_gradient.c
index c9493ae..627bd3e 100644
--- a/src/lib/ector/software/ector_software_gradient.c
+++ b/src/lib/ector/software/ector_software_gradient.c
@@ -280,9 +280,7 @@ _linear_helper_sse3(uint32_t *buffer, int length, Ector_Renderer_Software_Gradie
280 280
281#endif 281#endif
282 282
283typedef double (*BLEND_FUNC)(double progress); 283static inline double
284
285static double
286_ease_linear(double t) 284_ease_linear(double t)
287{ 285{
288 return t; 286 return t;
@@ -316,17 +314,14 @@ _generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_c
316 314
317 for (i = 0; i < stop_count - 1; ++i) 315 for (i = 0; i < stop_count - 1; ++i)
318 { 316 {
319 BLEND_FUNC func;
320
321 curr = (gradient_stops + i); 317 curr = (gradient_stops + i);
322 next = (gradient_stops + i + 1); 318 next = (gradient_stops + i + 1);
323 delta = 1/(next->offset - curr->offset); 319 delta = 1/(next->offset - curr->offset);
324 if (next->a != 255) alpha = EINA_TRUE; 320 if (next->a != 255) alpha = EINA_TRUE;
325 next_color = DRAW_ARGB_JOIN(next->a, next->r, next->g, next->b); 321 next_color = DRAW_ARGB_JOIN(next->a, next->r, next->g, next->b);
326 func = &_ease_linear;
327 while (fpos < next->offset && pos < size) 322 while (fpos < next->offset && pos < size)
328 { 323 {
329 t = func((fpos - curr->offset) * delta); 324 t = _ease_linear((fpos - curr->offset) * delta);
330 dist = (int)(256 * t); 325 dist = (int)(256 * t);
331 idist = 256 - dist; 326 idist = 256 - dist;
332 color_table[pos] = draw_interpolate_256(current_color, idist, next_color, dist); 327 color_table[pos] = draw_interpolate_256(current_color, idist, next_color, dist);