summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2014-02-08 16:26:01 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-02-08 16:26:01 +0900
commit72d90c07689ec1a328d280d7f562103cbfc65d9f (patch)
tree8d406a119a2d9054bb90d3c2f62ad000a138726a
parent131fc99e79dca3e5fe743cbbb8adcb0b3d2479eb (diff)
evas/common - code clean up
removed unncessary backet depth in.
-rw-r--r--src/lib/evas/common/evas_blend_main.c1
-rw-r--r--src/lib/evas/common/evas_map_image_core.c271
2 files changed, 130 insertions, 142 deletions
diff --git a/src/lib/evas/common/evas_blend_main.c b/src/lib/evas/common/evas_blend_main.c
index 6d3e0d8e29..b0221b135d 100644
--- a/src/lib/evas/common/evas_blend_main.c
+++ b/src/lib/evas/common/evas_blend_main.c
@@ -149,6 +149,7 @@ evas_common_gfx_func_composite_pixel_span_get(RGBA_Image *src, RGBA_Image *dst,
149 if (op == _EVAS_RENDER_BLEND) op = _EVAS_RENDER_COPY; 149 if (op == _EVAS_RENDER_BLEND) op = _EVAS_RENDER_COPY;
150 else if (op == _EVAS_RENDER_BLEND_REL) op = _EVAS_RENDER_COPY_REL; 150 else if (op == _EVAS_RENDER_BLEND_REL) op = _EVAS_RENDER_COPY_REL;
151 } 151 }
152
152 comp = evas_gfx_compositor_get(op); 153 comp = evas_gfx_compositor_get(op);
153 if (comp) 154 if (comp)
154 func = comp->composite_pixel_span_get(src, dst, pixels); 155 func = comp->composite_pixel_span_get(src, dst, pixels);
diff --git a/src/lib/evas/common/evas_map_image_core.c b/src/lib/evas/common/evas_map_image_core.c
index 7e44c4b161..8899162fa3 100644
--- a/src/lib/evas/common/evas_map_image_core.c
+++ b/src/lib/evas/common/evas_map_image_core.c
@@ -15,116 +15,109 @@
15 DATA32 c1, c2; // col 15 DATA32 c1, c2; // col
16#endif 16#endif
17 Line *line; 17 Line *line;
18
19#ifdef SCALE_USING_MMX 18#ifdef SCALE_USING_MMX
20 pxor_r2r(mm0, mm0); 19 pxor_r2r(mm0, mm0);
21 MOV_A2R(ALPHA_255, mm5) 20 MOV_A2R(ALPHA_255, mm5)
22#endif 21#endif
23
24 line = &(spans[y - ystart]); 22 line = &(spans[y - ystart]);
25 for (i = 0; i < 2; i++) 23 for (i = 0; i < 2; i++)
26 { 24 {
27 Span *span; 25 Span *span;
28
29 span = &(line->span[i]); 26 span = &(line->span[i]);
30 if (span->x1 >= 0) 27 if (span->x1 < 0) break;
31 {
32 long long tl;
33
34 x = span->x1;
35 w = (span->x2 - x);
36 if (w <= 0) continue;
37 dv = (span->o2 - span->o1);
38 if (dv <= 0) continue;
39
40 ww = w;
41 u = span->u[0] << FPI;
42 if (u < 0) u = 0;
43 else if (u > swp) u = swp;
44 v = span->v[0] << FPI;
45 if (v < 0) v = 0;
46 else if (v > shp) v = shp;
47 ue = span->u[1] << FPI;
48 if (ue < 0) ue = 0;
49 else if (ue > swp) ue = swp;
50 ve = span->v[1] << FPI;
51 if (ve < 0) ve = 0;
52 else if (ve > shp) ve = shp;
53 ud = (ue - u) / w;
54 vd = (ve - v) / w;
55 tl = (long long)ud * (w << FP);
56 tl = tl / dv;
57 ud = tl;
58 u -= (ud * (span->o1 - (span->x1 << FP))) / FP1;
59
60 tl = (long long)vd * (w << FP);
61 tl = tl / dv;
62 vd = tl;
63 v -= (vd * (span->o1 - (span->x1 << FP))) / FP1;
64 28
65 if (ud < 0) u += ud; 29 long long tl;
66 if (vd < 0) v += vd; 30 x = span->x1;
67 if (u < 0) u = 0; 31 w = (span->x2 - x);
68 else if (u >= swp) u = swp - 1; 32 if (w <= 0) continue;
69 if (v < 0) v = 0; 33 dv = (span->o2 - span->o1);
70 else if (v >= shp) v = shp - 1; 34 if (dv <= 0) continue;
71 35
72 if (direct) 36 ww = w;
73 d = dst->image.data + (y * dst->cache_entry.w) + x; 37 u = span->u[0] << FPI;
74 else 38 if (u < 0) u = 0;
75 d = buf; 39 else if (u > swp) u = swp;
40 v = span->v[0] << FPI;
41 if (v < 0) v = 0;
42 else if (v > shp) v = shp;
43 ue = span->u[1] << FPI;
44 if (ue < 0) ue = 0;
45 else if (ue > swp) ue = swp;
46 ve = span->v[1] << FPI;
47 if (ve < 0) ve = 0;
48 else if (ve > shp) ve = shp;
49 ud = (ue - u) / w;
50 vd = (ve - v) / w;
51 tl = (long long)ud * (w << FP);
52 tl = tl / dv;
53 ud = tl;
54 u -= (ud * (span->o1 - (span->x1 << FP))) / FP1;
55
56 tl = (long long)vd * (w << FP);
57 tl = tl / dv;
58 vd = tl;
59 v -= (vd * (span->o1 - (span->x1 << FP))) / FP1;
76 60
61 if (ud < 0) u += ud;
62 if (vd < 0) v += vd;
63 if (u < 0) u = 0;
64 else if (u >= swp) u = swp - 1;
65 if (v < 0) v = 0;
66 else if (v >= shp) v = shp - 1;
67
68 if (direct)
69 d = dst->image.data + (y * dst->cache_entry.w) + x;
70 else
71 d = buf;
77#define SMOOTH 1 72#define SMOOTH 1
78#ifdef COLMUL 73#ifdef COLMUL
79 c1 = span->col[0]; // col 74 c1 = span->col[0]; // col
80 c2 = span->col[1]; // col 75 c2 = span->col[1]; // col
81 cv = 0; // col 76 cv = 0; // col
82 cd = (255 << 16) / w; // col 77 cd = (255 << 16) / w; // col
83 78
84 if (c1 == c2) 79 if (c1 == c2)
80 {
81 if (c1 == 0xffffffff)
85 { 82 {
86 if (c1 == 0xffffffff)
87 {
88#endif 83#endif
89#define COLSAME 1 84#define COLSAME 1
90#include "evas_map_image_loop.c" 85#include "evas_map_image_loop.c"
91#undef COLSAME 86#undef COLSAME
92#ifdef COLMUL 87#ifdef COLMUL
93 } 88 }
94 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha)) 89 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha))
95 { 90 {
96 // all black line 91 // all black line
97# define COLBLACK 1 92# define COLBLACK 1
98# define COLSAME 1 93# define COLSAME 1
99# include "evas_map_image_loop.c" 94# include "evas_map_image_loop.c"
100# undef COLSAME 95# undef COLSAME
101# undef COLBLACK 96# undef COLBLACK
102 }
103 else if (c1 == 0x000000)
104 {
105 // skip span
106 }
107 else
108 {
109 // generic loop
110# define COLSAME 1
111# include "evas_map_image_loop.c"
112# undef COLSAME
113 }
114 } 97 }
115 else 98 else if (c1 == 0x000000)
116 { 99 {
117# include "evas_map_image_loop.c" 100 // skip span
118 } 101 }
119#endif 102 else
120 if (!direct)
121 { 103 {
122 d = dst->image.data; 104 // generic loop
123 d += (y * dst->cache_entry.w) + x; 105# define COLSAME 1
124 func(buf, NULL, mul_col, d, w); 106# include "evas_map_image_loop.c"
107# undef COLSAME
125 } 108 }
126 } 109 }
127 else break; 110 else
111 {
112# include "evas_map_image_loop.c"
113 }
114#endif
115 if (!direct)
116 {
117 d = dst->image.data;
118 d += (y * dst->cache_entry.w) + x;
119 func(buf, NULL, mul_col, d, w);
120 }
128 } 121 }
129 } 122 }
130 } 123 }
@@ -140,98 +133,92 @@
140 DATA32 c1, c2; // col 133 DATA32 c1, c2; // col
141#endif 134#endif
142 Line *line; 135 Line *line;
143
144 line = &(spans[y - ystart]); 136 line = &(spans[y - ystart]);
145 for (i = 0; i < 2; i++) 137 for (i = 0; i < 2; i++)
146 { 138 {
147 Span *span; 139 Span *span;
148
149 span = &(line->span[i]); 140 span = &(line->span[i]);
150 if (span->x1 >= 0) 141 if (span->x1 < 0) break;
151 {
152 x = span->x1;
153 w = (span->x2 - x);
154
155 if (w <= 0) continue;
156 ww = w;
157 u = span->u[0] << FPI;
158 if (u < 0) u = 0;
159 else if (u > swp) u = swp;
160 v = span->v[0] << FPI;
161 if (v < 0) v = 0;
162 else if (v > shp) v = shp;
163 ue = span->u[1] << FPI;
164 if (ue < 0) ue = 0;
165 else if (ue > swp) ue = swp;
166 ve = span->v[1] << FPI;
167 if (ve < 0) ve = 0;
168 else if (ve > shp) ve = shp;
169 ud = (ue - u) / w;
170 vd = (ve - v) / w;
171 if (direct)
172 d = dst->image.data + (y * dst->cache_entry.w) + x;
173 else
174 d = buf;
175 142
176 if (ud < 0) u += ud; 143 x = span->x1;
177 if (vd < 0) v += vd; 144 w = (span->x2 - x);
178 if (u < 0) u = 0;
179 else if (u >= swp) u = swp - 1;
180 if (v < 0) v = 0;
181 else if (v >= shp) v = shp - 1;
182 145
146 if (w <= 0) continue;
147 ww = w;
148 u = span->u[0] << FPI;
149 if (u < 0) u = 0;
150 else if (u > swp) u = swp;
151 v = span->v[0] << FPI;
152 if (v < 0) v = 0;
153 else if (v > shp) v = shp;
154 ue = span->u[1] << FPI;
155 if (ue < 0) ue = 0;
156 else if (ue > swp) ue = swp;
157 ve = span->v[1] << FPI;
158 if (ve < 0) ve = 0;
159 else if (ve > shp) ve = shp;
160 ud = (ue - u) / w;
161 vd = (ve - v) / w;
162 if (direct)
163 d = dst->image.data + (y * dst->cache_entry.w) + x;
164 else
165 d = buf;
166 if (ud < 0) u += ud;
167 if (vd < 0) v += vd;
168 if (u < 0) u = 0;
169 else if (u >= swp) u = swp - 1;
170 if (v < 0) v = 0;
171 else if (v >= shp) v = shp - 1;
183#undef SMOOTH 172#undef SMOOTH
184#ifdef COLMUL 173#ifdef COLMUL
185 c1 = span->col[0]; // col 174 c1 = span->col[0]; // col
186 c2 = span->col[1]; // col 175 c2 = span->col[1]; // col
187 cv = 0; // col 176 cv = 0; // col
188 cd = (255 << 16) / w; // col 177 cd = (255 << 16) / w; // col
189 178
190 if (c1 == c2) 179 if (c1 == c2)
180 {
181 if (c1 == 0xffffffff)
191 { 182 {
192 if (c1 == 0xffffffff)
193 {
194#endif 183#endif
195#define COLSAME 1 184#define COLSAME 1
196#include "evas_map_image_loop.c" 185#include "evas_map_image_loop.c"
197#undef COLSAME 186#undef COLSAME
198#ifdef COLMUL 187#ifdef COLMUL
199 } 188 }
200 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha)) 189 else if ((c1 == 0x0000ff) && (!src->cache_entry.flags.alpha))
201 { 190 {
202 // all black line 191 // all black line
203# define COLBLACK 1 192# define COLBLACK 1
204# define COLSAME 1 193# define COLSAME 1
205# include "evas_map_image_loop.c" 194# include "evas_map_image_loop.c"
206# undef COLSAME 195# undef COLSAME
207# undef COLBLACK 196# undef COLBLACK
208 } 197 }
209 else if (c1 == 0x000000) 198 else if (c1 == 0x000000)
210 { 199 {
211 // skip span 200 // skip span
212 }
213 else
214 {
215 // generic loop
216# define COLSAME 1
217# include "evas_map_image_loop.c"
218# undef COLSAME
219 }
220 } 201 }
221 else 202 else
222 { 203 {
223 // generic loop 204 // generic loop
205# define COLSAME 1
224# include "evas_map_image_loop.c" 206# include "evas_map_image_loop.c"
207# undef COLSAME
225 } 208 }
226#endif
227 if (!direct)
228 {
229 d = dst->image.data;
230 d += (y * dst->cache_entry.w) + x;
231 func(buf, NULL, mul_col, d, w);
232 }
233 } 209 }
234 else break; 210 else
211 {
212 // generic loop
213# include "evas_map_image_loop.c"
214 }
215#endif
216 if (!direct)
217 {
218 d = dst->image.data;
219 d += (y * dst->cache_entry.w) + x;
220 func(buf, NULL, mul_col, d, w);
221 }
235 } 222 }
236 } 223 }
237 } 224 }