summaryrefslogtreecommitdiff
path: root/src/lib/ector/software/ector_software_gradient.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-12-19 20:27:11 +0900
committerHermet Park <hermetpark@gmail.com>2019-12-19 20:30:31 +0900
commit11a1fc9f2b6c6da4bc0000acfdb7840248bb6c78 (patch)
tree5730cddbb9f449ff1f03e98bfdaf55c55d2b5dd3 /src/lib/ector/software/ector_software_gradient.c
parente2887ec2aaddb3176be180fc0bfc050508559773 (diff)
ector software: catch up losing tasks among the threads.
This is a subsequent change after 8465904c19ea3de2c94c25259ca6a75d0241b4f1. The major change is almost same but just for gradient stuff.
Diffstat (limited to 'src/lib/ector/software/ector_software_gradient.c')
-rw-r--r--src/lib/ector/software/ector_software_gradient.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/ector/software/ector_software_gradient.c b/src/lib/ector/software/ector_software_gradient.c
index 1681d80724..be20635e29 100644
--- a/src/lib/ector/software/ector_software_gradient.c
+++ b/src/lib/ector/software/ector_software_gradient.c
@@ -11,7 +11,6 @@ void _linear_helper_sse3(uint32_t *buffer, int length, Ector_Renderer_Software_G
11 11
12typedef void (*Ector_Radial_Helper_Func)(uint32_t *buffer, int length, Ector_Renderer_Software_Gradient_Data *g_data, 12typedef void (*Ector_Radial_Helper_Func)(uint32_t *buffer, int length, Ector_Renderer_Software_Gradient_Data *g_data,
13 float det, float delta_det, float delta_delta_det, float b, float delta_b); 13 float det, float delta_det, float delta_delta_det, float b, float delta_b);
14
15typedef void (*Ector_Linear_Helper_Func)(uint32_t *buffer, int length, Ector_Renderer_Software_Gradient_Data *g_data, 14typedef void (*Ector_Linear_Helper_Func)(uint32_t *buffer, int length, Ector_Renderer_Software_Gradient_Data *g_data,
16 int t_fixed, int inc_fixed); 15 int t_fixed, int inc_fixed);
17 16
@@ -22,8 +21,6 @@ static void
22_update_color_table(void *data, Ector_Software_Thread *t EINA_UNUSED) 21_update_color_table(void *data, Ector_Software_Thread *t EINA_UNUSED)
23{ 22{
24 Ector_Renderer_Software_Gradient_Data *gdata = data; 23 Ector_Renderer_Software_Gradient_Data *gdata = data;
25
26 gdata->color_table = malloc(GRADIENT_STOPTABLE_SIZE * 4);
27 gdata->alpha = efl_draw_generate_gradient_color_table(gdata->gd->colors, gdata->gd->colors_count, 24 gdata->alpha = efl_draw_generate_gradient_color_table(gdata->gd->colors, gdata->gd->colors_count,
28 gdata->color_table, GRADIENT_STOPTABLE_SIZE); 25 gdata->color_table, GRADIENT_STOPTABLE_SIZE);
29} 26}
@@ -32,24 +29,27 @@ static void
32_done_color_table(void *data) 29_done_color_table(void *data)
33{ 30{
34 Ector_Renderer_Software_Gradient_Data *gdata = data; 31 Ector_Renderer_Software_Gradient_Data *gdata = data;
35 32 gdata->ctable_status = CTABLE_READY_DONE;
36 gdata->done = EINA_TRUE;
37} 33}
38 34
39void 35void
40ector_software_gradient_color_update(Ector_Renderer_Software_Gradient_Data *gdata) 36ector_software_gradient_color_update(Ector_Renderer_Software_Gradient_Data *gdata)
41{ 37{
42 if (!gdata->done) 38 if (gdata->ctable_status == CTABLE_READY_DONE) return;
43 { 39
44 ector_software_wait(_update_color_table, _done_color_table, gdata); 40 //OPTIMIZE: This color can be updated only when gradient properties are changed.
45 return ;
46 }
47 41
42 //Alloc only one time.
48 if (!gdata->color_table) 43 if (!gdata->color_table)
44 gdata->color_table = malloc(GRADIENT_STOPTABLE_SIZE * 4);
45
46 if (gdata->ctable_status == CTABLE_NOT_READY)
49 { 47 {
50 gdata->done = EINA_FALSE; 48 gdata->ctable_status = CTABLE_PROCESSING;
51 ector_software_schedule(_update_color_table, _done_color_table, gdata); 49 ector_software_schedule(_update_color_table, _done_color_table, gdata);
52 } 50 }
51 else if (gdata->ctable_status == CTABLE_PROCESSING)
52 ector_software_wait(_update_color_table, _done_color_table, gdata);
53} 53}
54 54
55void 55void