summaryrefslogtreecommitdiff
path: root/src/lib/ector/software/ector_software_gradient.c
diff options
context:
space:
mode:
authorSubhransu Sekhar Mohanty <sub.mohanty@samsung.com>2015-04-03 16:33:50 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:33:50 +0200
commit0ec75ca05f23fc586ca3372fa3f87ef3cf2412a0 (patch)
tree828abdb628c426e91c69f61c111e60a454198f42 /src/lib/ector/software/ector_software_gradient.c
parent1d0ce5bc05fb6658f2ede82c20f62687a4dc8d3e (diff)
ector: fix coding style of freetype backend.
Diffstat (limited to 'src/lib/ector/software/ector_software_gradient.c')
-rw-r--r--src/lib/ector/software/ector_software_gradient.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/ector/software/ector_software_gradient.c b/src/lib/ector/software/ector_software_gradient.c
index fd842dd4cd..5c3bcde3b4 100644
--- a/src/lib/ector/software/ector_software_gradient.c
+++ b/src/lib/ector/software/ector_software_gradient.c
@@ -53,14 +53,14 @@ static uint
53_gradient_pixel_fixed(const Ector_Renderer_Software_Gradient_Data *data, int fixed_pos) 53_gradient_pixel_fixed(const Ector_Renderer_Software_Gradient_Data *data, int fixed_pos)
54{ 54{
55 int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS; 55 int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
56 return data->colorTable[_gradient_clamp(data, ipos)]; 56 return data->color_table[_gradient_clamp(data, ipos)];
57} 57}
58 58
59static inline uint 59static inline uint
60_gradient_pixel(const Ector_Renderer_Software_Gradient_Data *data, float pos) 60_gradient_pixel(const Ector_Renderer_Software_Gradient_Data *data, float pos)
61{ 61{
62 int ipos = (int)(pos * (GRADIENT_STOPTABLE_SIZE - 1) + (float)(0.5)); 62 int ipos = (int)(pos * (GRADIENT_STOPTABLE_SIZE - 1) + (float)(0.5));
63 return data->colorTable[_gradient_clamp(data, ipos)]; 63 return data->color_table[_gradient_clamp(data, ipos)];
64} 64}
65 65
66typedef double (*BLEND_FUNC)(double progress); 66typedef double (*BLEND_FUNC)(double progress);
@@ -72,7 +72,7 @@ _ease_linear(double t)
72} 72}
73 73
74static void 74static void
75_generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_count, uint *colorTable, int size) 75_generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_count, uint *color_table, int size)
76{ 76{
77 int pos = 0; 77 int pos = 0;
78 Efl_Gfx_Gradient_Stop *curr, *next; 78 Efl_Gfx_Gradient_Stop *curr, *next;
@@ -83,11 +83,11 @@ _generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_c
83 double incr = 1.0 / (double)size; 83 double incr = 1.0 / (double)size;
84 double fpos = 1.5 * incr; 84 double fpos = 1.5 * incr;
85 85
86 colorTable[pos++] = current_color; 86 color_table[pos++] = current_color;
87 87
88 while (fpos <= curr->offset) 88 while (fpos <= curr->offset)
89 { 89 {
90 colorTable[pos] = colorTable[pos - 1]; 90 color_table[pos] = color_table[pos - 1];
91 pos++; 91 pos++;
92 fpos += incr; 92 fpos += incr;
93 } 93 }
@@ -104,7 +104,7 @@ _generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_c
104 double t = func((fpos - curr->offset) * delta); 104 double t = func((fpos - curr->offset) * delta);
105 int dist = (int)(256 * t); 105 int dist = (int)(256 * t);
106 int idist = 256 - dist; 106 int idist = 256 - dist;
107 colorTable[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist); 107 color_table[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist);
108 ++pos; 108 ++pos;
109 fpos += incr; 109 fpos += incr;
110 } 110 }
@@ -112,29 +112,29 @@ _generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_c
112 } 112 }
113 113
114 for (;pos < size; ++pos) 114 for (;pos < size; ++pos)
115 colorTable[pos] = current_color; 115 color_table[pos] = current_color;
116 116
117 // Make sure the last color stop is represented at the end of the table 117 // Make sure the last color stop is represented at the end of the table
118 colorTable[size-1] = current_color; 118 color_table[size-1] = current_color;
119} 119}
120 120
121 121
122void 122void
123update_color_table(Ector_Renderer_Software_Gradient_Data *gdata) 123update_color_table(Ector_Renderer_Software_Gradient_Data *gdata)
124{ 124{
125 if(gdata->colorTable) return; 125 if(gdata->color_table) return;
126 126
127 gdata->colorTable = malloc(GRADIENT_STOPTABLE_SIZE * 4); 127 gdata->color_table = malloc(GRADIENT_STOPTABLE_SIZE * 4);
128 _generate_gradient_color_table(gdata->gd->colors, gdata->gd->colors_count, gdata->colorTable, GRADIENT_STOPTABLE_SIZE); 128 _generate_gradient_color_table(gdata->gd->colors, gdata->gd->colors_count, gdata->color_table, GRADIENT_STOPTABLE_SIZE);
129} 129}
130 130
131void 131void
132destroy_color_table(Ector_Renderer_Software_Gradient_Data *gdata) 132destroy_color_table(Ector_Renderer_Software_Gradient_Data *gdata)
133{ 133{
134 if (gdata->colorTable) 134 if (gdata->color_table)
135 { 135 {
136 free(gdata->colorTable); 136 free(gdata->color_table);
137 gdata->colorTable = NULL; 137 gdata->color_table = NULL;
138 } 138 }
139} 139}
140 140