summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2007-04-24 11:16:24 +0000
committerCarsten Haitzler <raster@rasterman.com>2007-04-24 11:16:24 +0000
commit970bc1e2a14e421ad5059a1dc2deab8fd612e5cc (patch)
treeae637610a238c88d9655213905dc8c0245450731 /legacy/evas
parentdb70aa52ac84472789772b005ae85fa1f373c45e (diff)
patches into cvs we go.
SVN revision: 29708
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/AUTHORS1
-rw-r--r--legacy/evas/configure.in24
-rw-r--r--legacy/evas/src/lib/engines/common/evas_convert_rgb_16.c260
3 files changed, 285 insertions, 0 deletions
diff --git a/legacy/evas/AUTHORS b/legacy/evas/AUTHORS
index 0efa166..a89026b 100644
--- a/legacy/evas/AUTHORS
+++ b/legacy/evas/AUTHORS
@@ -11,3 +11,4 @@ Jose O Gonzalez <jose_ogp@juno.com>
11Bernhard Nemec <Bernhard.Nemec@viasyshc.com> 11Bernhard Nemec <Bernhard.Nemec@viasyshc.com>
12Jorge Luis Zapata Muga <jorgeluis.zapata@gmail.com> 12Jorge Luis Zapata Muga <jorgeluis.zapata@gmail.com>
13Cedric Bail <cedric.bail@free.fr> 13Cedric Bail <cedric.bail@free.fr>
14Gustavo Sverzut Barbieri <barbieri@gmail.com>
diff --git a/legacy/evas/configure.in b/legacy/evas/configure.in
index 29e8cab..bb9212e 100644
--- a/legacy/evas/configure.in
+++ b/legacy/evas/configure.in
@@ -1257,6 +1257,29 @@ AC_ARG_ENABLE(small-dither-mask,
1257) 1257)
1258 1258
1259####################################### 1259#######################################
1260## No dither mask at all for 16bpp
1261conv_no_dither="no"
1262conv_no_dither="no"
1263AC_MSG_CHECKING(whether to build without dither mask for 16bpp)
1264AC_ARG_ENABLE(no-dither-mask,
1265 [ --enable-no-dither-mask enable conversion to 16bpp without dither mask], [
1266 if test x"$enableval" = x"yes" ; then
1267 AC_MSG_RESULT(yes)
1268 AC_DEFINE(BUILD_NO_DITHER_MASK, 1, [No Dither Mask Support])
1269 conv_no_dither="yes"
1270 else
1271 AC_MSG_RESULT(no)
1272 conv_no_dither="no"
1273 fi
1274 ], [
1275 AC_MSG_RESULT($conv_no_dither)
1276 if test x"$conv_no_dither" = x"yes" ; then
1277 AC_DEFINE(BUILD_NO_DITHER_MASK, 1, [No Dither Mask Support])
1278 fi
1279 ]
1280)
1281
1282#######################################
1260## Convert to 8bpp RGB 332 1283## Convert to 8bpp RGB 332
1261conv_8_rgb_332="no" 1284conv_8_rgb_332="no"
1262conv_8_rgb_332="yes" 1285conv_8_rgb_332="yes"
@@ -2049,6 +2072,7 @@ echo " YUV Converter...........: $conv_yuv"
2049echo 2072echo
2050echo "ARGB Conversion Options:" 2073echo "ARGB Conversion Options:"
2051echo " Smaller Dither Mask.....: $conv_small_dither" 2074echo " Smaller Dither Mask.....: $conv_small_dither"
2075echo " No Dither Mask for 16bpp: $conv_no_dither"
2052echo " 8bpp RGB 332............: $conv_8_rgb_332" 2076echo " 8bpp RGB 332............: $conv_8_rgb_332"
2053echo " 8bpp RGB 666............: $conv_8_rgb_666" 2077echo " 8bpp RGB 666............: $conv_8_rgb_666"
2054echo " 8bpp RGB 232............: $conv_8_rgb_232" 2078echo " 8bpp RGB 232............: $conv_8_rgb_232"
diff --git a/legacy/evas/src/lib/engines/common/evas_convert_rgb_16.c b/legacy/evas/src/lib/engines/common/evas_convert_rgb_16.c
index c817f93..18976d7 100644
--- a/legacy/evas/src/lib/engines/common/evas_convert_rgb_16.c
+++ b/legacy/evas/src/lib/engines/common/evas_convert_rgb_16.c
@@ -1,11 +1,13 @@
1#include "evas_common.h" 1#include "evas_common.h"
2 2
3#ifndef BUILD_NO_DITHER_MASK
3#ifdef USE_DITHER_44 4#ifdef USE_DITHER_44
4extern const DATA8 _evas_dither_44[4][4]; 5extern const DATA8 _evas_dither_44[4][4];
5#endif 6#endif
6#ifdef USE_DITHER_128128 7#ifdef USE_DITHER_128128
7extern const DATA8 _evas_dither_128128[128][128]; 8extern const DATA8 _evas_dither_128128[128][128];
8#endif 9#endif
10#endif
9 11
10#ifdef BUILD_CONVERT_16_RGB_565 12#ifdef BUILD_CONVERT_16_RGB_565
11#ifdef BUILD_CONVERT_16_RGB_ROT0 13#ifdef BUILD_CONVERT_16_RGB_ROT0
@@ -17,7 +19,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int sr
17 int x, y; 19 int x, y;
18 DATA8 r1, g1, b1; 20 DATA8 r1, g1, b1;
19 DATA8 r2, g2, b2; 21 DATA8 r2, g2, b2;
22#ifndef BUILD_NO_DITHER_MASK
20 DATA8 dith, dith2; 23 DATA8 dith, dith2;
24#endif
21 25
22 dst_ptr = (DATA16 *)dst; 26 dst_ptr = (DATA16 *)dst;
23 27
@@ -26,21 +30,25 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int sr
26 r1 = (R_VAL(src_ptr)) >> 3; 30 r1 = (R_VAL(src_ptr)) >> 3;
27 g1 = (G_VAL(src_ptr)) >> 2; 31 g1 = (G_VAL(src_ptr)) >> 2;
28 b1 = (B_VAL(src_ptr)) >> 3; 32 b1 = (B_VAL(src_ptr)) >> 3;
33#ifndef BUILD_NO_DITHER_MASK
29 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 34 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
30 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 35 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
31 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 36 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
32 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 37 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
33 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 38 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
39#endif
34 CONVERT_LOOP2_INC_ROT_0(); 40 CONVERT_LOOP2_INC_ROT_0();
35 41
36 r2 = (R_VAL(src_ptr)) >> 3; 42 r2 = (R_VAL(src_ptr)) >> 3;
37 g2 = (G_VAL(src_ptr)) >> 2; 43 g2 = (G_VAL(src_ptr)) >> 2;
38 b2 = (B_VAL(src_ptr)) >> 3; 44 b2 = (B_VAL(src_ptr)) >> 3;
45#ifndef BUILD_NO_DITHER_MASK
39 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 46 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
40 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 47 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
41 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 48 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
42 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 49 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
43 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 50 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
51#endif
44 52
45#ifndef WORDS_BIGENDIAN 53#ifndef WORDS_BIGENDIAN
46 *((DATA32 *)dst_ptr) = 54 *((DATA32 *)dst_ptr) =
@@ -68,7 +76,9 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src
68 DATA16 *dst_ptr; 76 DATA16 *dst_ptr;
69 int x, y; 77 int x, y;
70 DATA8 r, g, b; 78 DATA8 r, g, b;
79#ifndef BUILD_NO_DITHER_MASK
71 DATA8 dith, dith2; 80 DATA8 dith, dith2;
81#endif
72 82
73 dst_ptr = (DATA16 *)dst; 83 dst_ptr = (DATA16 *)dst;
74 84
@@ -77,11 +87,14 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith (DATA32 *src, DATA8 *dst, int src
77 r = (R_VAL(src_ptr)) >> 3; 87 r = (R_VAL(src_ptr)) >> 3;
78 g = (G_VAL(src_ptr)) >> 2; 88 g = (G_VAL(src_ptr)) >> 2;
79 b = (B_VAL(src_ptr)) >> 3; 89 b = (B_VAL(src_ptr)) >> 3;
90
91#ifndef BUILD_NO_DITHER_MASK
80 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 92 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
81 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 93 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
82 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 94 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
83 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 95 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
84 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 96 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
97#endif
85 98
86 *dst_ptr = (r << 11) | (g << 5) | (b); 99 *dst_ptr = (r << 11) | (g << 5) | (b);
87 100
@@ -102,7 +115,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst
102 int x, y; 115 int x, y;
103 DATA8 r1, g1, b1; 116 DATA8 r1, g1, b1;
104 DATA8 r2, g2, b2; 117 DATA8 r2, g2, b2;
118#ifndef BUILD_NO_DITHER_MASK
105 DATA8 dith, dith2; 119 DATA8 dith, dith2;
120#endif
106 121
107 dst_ptr = (DATA16 *)dst; 122 dst_ptr = (DATA16 *)dst;
108 123
@@ -111,22 +126,28 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst
111 r1 = (R_VAL(src_ptr)) >> 3; 126 r1 = (R_VAL(src_ptr)) >> 3;
112 g1 = (G_VAL(src_ptr)) >> 2; 127 g1 = (G_VAL(src_ptr)) >> 2;
113 b1 = (B_VAL(src_ptr)) >> 3; 128 b1 = (B_VAL(src_ptr)) >> 3;
129
130#ifndef BUILD_NO_DITHER_MASK
114 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 131 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
115 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 132 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
116 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 133 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
117 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 134 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
118 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 135 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
136#endif
119 137
120 CONVERT_LOOP2_INC_ROT_180(); 138 CONVERT_LOOP2_INC_ROT_180();
121 139
122 r2 = (R_VAL(src_ptr)) >> 3; 140 r2 = (R_VAL(src_ptr)) >> 3;
123 g2 = (G_VAL(src_ptr)) >> 2; 141 g2 = (G_VAL(src_ptr)) >> 2;
124 b2 = (B_VAL(src_ptr)) >> 3; 142 b2 = (B_VAL(src_ptr)) >> 3;
143
144#ifndef BUILD_NO_DITHER_MASK
125 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 145 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
126 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 146 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
127 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 147 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
128 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 148 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
129 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 149 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
150#endif
130 151
131#ifndef WORDS_BIGENDIAN 152#ifndef WORDS_BIGENDIAN
132 *((DATA32 *)dst_ptr) = 153 *((DATA32 *)dst_ptr) =
@@ -154,7 +175,9 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
154 DATA16 *dst_ptr; 175 DATA16 *dst_ptr;
155 int x, y; 176 int x, y;
156 DATA8 r, g, b; 177 DATA8 r, g, b;
178#ifndef BUILD_NO_DITHER_MASK
157 DATA8 dith, dith2; 179 DATA8 dith, dith2;
180#endif
158 181
159 dst_ptr = (DATA16 *)dst; 182 dst_ptr = (DATA16 *)dst;
160 183
@@ -163,11 +186,14 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
163 r = (R_VAL(src_ptr)) >> 3; 186 r = (R_VAL(src_ptr)) >> 3;
164 g = (G_VAL(src_ptr)) >> 2; 187 g = (G_VAL(src_ptr)) >> 2;
165 b = (B_VAL(src_ptr)) >> 3; 188 b = (B_VAL(src_ptr)) >> 3;
189
190#ifndef BUILD_NO_DITHER_MASK
166 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 191 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
167 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 192 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
168 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 193 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
169 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 194 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
170 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 195 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
196#endif
171 197
172 *dst_ptr = (r << 11) | (g << 5) | (b); 198 *dst_ptr = (r << 11) | (g << 5) | (b);
173 199
@@ -188,7 +214,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst
188 int x, y; 214 int x, y;
189 DATA8 r1, g1, b1; 215 DATA8 r1, g1, b1;
190 DATA8 r2, g2, b2; 216 DATA8 r2, g2, b2;
217#ifndef BUILD_NO_DITHER_MASK
191 DATA8 dith, dith2; 218 DATA8 dith, dith2;
219#endif
192 220
193 dst_ptr = (DATA16 *)dst; 221 dst_ptr = (DATA16 *)dst;
194 222
@@ -197,22 +225,28 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst
197 r1 = (R_VAL(src_ptr)) >> 3; 225 r1 = (R_VAL(src_ptr)) >> 3;
198 g1 = (G_VAL(src_ptr)) >> 2; 226 g1 = (G_VAL(src_ptr)) >> 2;
199 b1 = (B_VAL(src_ptr)) >> 3; 227 b1 = (B_VAL(src_ptr)) >> 3;
228
229#ifndef BUILD_NO_DITHER_MASK
200 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 230 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
201 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 231 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
202 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 232 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
203 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 233 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
204 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 234 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
235#endif
205 236
206 CONVERT_LOOP2_INC_ROT_270(); 237 CONVERT_LOOP2_INC_ROT_270();
207 238
208 r2 = (R_VAL(src_ptr)) >> 3; 239 r2 = (R_VAL(src_ptr)) >> 3;
209 g2 = (G_VAL(src_ptr)) >> 2; 240 g2 = (G_VAL(src_ptr)) >> 2;
210 b2 = (B_VAL(src_ptr)) >> 3; 241 b2 = (B_VAL(src_ptr)) >> 3;
242
243#ifndef BUILD_NO_DITHER_MASK
211 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 244 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
212 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 245 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
213 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 246 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
214 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 247 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
215 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 248 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
249#endif
216 250
217#ifndef WORDS_BIGENDIAN 251#ifndef WORDS_BIGENDIAN
218 *((DATA32 *)dst_ptr) = 252 *((DATA32 *)dst_ptr) =
@@ -240,7 +274,9 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst,
240 DATA16 *dst_ptr; 274 DATA16 *dst_ptr;
241 int x, y; 275 int x, y;
242 DATA8 r, g, b; 276 DATA8 r, g, b;
277#ifndef BUILD_NO_DITHER_MASK
243 DATA8 dith, dith2; 278 DATA8 dith, dith2;
279#endif
244 280
245 dst_ptr = (DATA16 *)dst; 281 dst_ptr = (DATA16 *)dst;
246 282
@@ -249,11 +285,14 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_270 (DATA32 *src, DATA8 *dst,
249 r = (R_VAL(src_ptr)) >> 3; 285 r = (R_VAL(src_ptr)) >> 3;
250 g = (G_VAL(src_ptr)) >> 2; 286 g = (G_VAL(src_ptr)) >> 2;
251 b = (B_VAL(src_ptr)) >> 3; 287 b = (B_VAL(src_ptr)) >> 3;
288
289#ifndef BUILD_NO_DITHER_MASK
252 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 290 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
253 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 291 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
254 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 292 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
255 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 293 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
256 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 294 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
295#endif
257 296
258 *dst_ptr = (r << 11) | (g << 5) | (b); 297 *dst_ptr = (r << 11) | (g << 5) | (b);
259 298
@@ -274,7 +313,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
274 int x, y; 313 int x, y;
275 DATA8 r1, g1, b1; 314 DATA8 r1, g1, b1;
276 DATA8 r2, g2, b2; 315 DATA8 r2, g2, b2;
316#ifndef BUILD_NO_DITHER_MASK
277 DATA8 dith, dith2; 317 DATA8 dith, dith2;
318#endif
278 319
279 dst_ptr = (DATA16 *)dst; 320 dst_ptr = (DATA16 *)dst;
280 321
@@ -283,22 +324,28 @@ evas_common_convert_rgba2_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
283 r1 = (R_VAL(src_ptr)) >> 3; 324 r1 = (R_VAL(src_ptr)) >> 3;
284 g1 = (G_VAL(src_ptr)) >> 2; 325 g1 = (G_VAL(src_ptr)) >> 2;
285 b1 = (B_VAL(src_ptr)) >> 3; 326 b1 = (B_VAL(src_ptr)) >> 3;
327
328#ifndef BUILD_NO_DITHER_MASK
286 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 329 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
287 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 330 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
288 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 331 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
289 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 332 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
290 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 333 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
334#endif
291 335
292 CONVERT_LOOP2_INC_ROT_90(); 336 CONVERT_LOOP2_INC_ROT_90();
293 337
294 r2 = (R_VAL(src_ptr)) >> 3; 338 r2 = (R_VAL(src_ptr)) >> 3;
295 g2 = (G_VAL(src_ptr)) >> 2; 339 g2 = (G_VAL(src_ptr)) >> 2;
296 b2 = (B_VAL(src_ptr)) >> 3; 340 b2 = (B_VAL(src_ptr)) >> 3;
341
342#ifndef BUILD_NO_DITHER_MASK
297 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 343 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
298 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 344 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
299 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 345 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
300 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 346 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
301 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 347 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
348#endif
302 349
303#ifndef WORDS_BIGENDIAN 350#ifndef WORDS_BIGENDIAN
304 *((DATA32 *)dst_ptr) = 351 *((DATA32 *)dst_ptr) =
@@ -326,7 +373,9 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
326 DATA16 *dst_ptr; 373 DATA16 *dst_ptr;
327 int x, y; 374 int x, y;
328 DATA8 r, g, b; 375 DATA8 r, g, b;
376#ifndef BUILD_NO_DITHER_MASK
329 DATA8 dith, dith2; 377 DATA8 dith, dith2;
378#endif
330 379
331 dst_ptr = (DATA16 *)dst; 380 dst_ptr = (DATA16 *)dst;
332 381
@@ -335,11 +384,14 @@ evas_common_convert_rgba_to_16bpp_rgb_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
335 r = (R_VAL(src_ptr)) >> 3; 384 r = (R_VAL(src_ptr)) >> 3;
336 g = (G_VAL(src_ptr)) >> 2; 385 g = (G_VAL(src_ptr)) >> 2;
337 b = (B_VAL(src_ptr)) >> 3; 386 b = (B_VAL(src_ptr)) >> 3;
387
388#ifndef BUILD_NO_DITHER_MASK
338 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 389 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
339 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 390 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
340 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 391 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
341 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 392 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
342 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 393 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
394#endif
343 395
344 *dst_ptr = (r << 11) | (g << 5) | (b); 396 *dst_ptr = (r << 11) | (g << 5) | (b);
345 397
@@ -360,7 +412,9 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int sr
360 int x, y; 412 int x, y;
361 DATA8 r1, g1, b1; 413 DATA8 r1, g1, b1;
362 DATA8 r2, g2, b2; 414 DATA8 r2, g2, b2;
415#ifndef BUILD_NO_DITHER_MASK
363 DATA8 dith, dith2; 416 DATA8 dith, dith2;
417#endif
364 418
365 dst_ptr = (DATA16 *)dst; 419 dst_ptr = (DATA16 *)dst;
366 420
@@ -369,22 +423,28 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int sr
369 r1 = (R_VAL(src_ptr)) >> 3; 423 r1 = (R_VAL(src_ptr)) >> 3;
370 g1 = (G_VAL(src_ptr)) >> 2; 424 g1 = (G_VAL(src_ptr)) >> 2;
371 b1 = (B_VAL(src_ptr)) >> 3; 425 b1 = (B_VAL(src_ptr)) >> 3;
426
427#ifndef BUILD_NO_DITHER_MASK
372 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 428 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
373 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 429 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
374 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 430 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
375 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 431 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
376 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 432 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
433#endif
377 434
378 CONVERT_LOOP2_INC_ROT_0(); 435 CONVERT_LOOP2_INC_ROT_0();
379 436
380 r2 = (R_VAL(src_ptr)) >> 3; 437 r2 = (R_VAL(src_ptr)) >> 3;
381 g2 = (G_VAL(src_ptr)) >> 2; 438 g2 = (G_VAL(src_ptr)) >> 2;
382 b2 = (B_VAL(src_ptr)) >> 3; 439 b2 = (B_VAL(src_ptr)) >> 3;
440
441#ifndef BUILD_NO_DITHER_MASK
383 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 442 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
384 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 443 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
385 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 444 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
386 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 445 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
387 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 446 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
447#endif
388 448
389#ifndef WORDS_BIGENDIAN 449#ifndef WORDS_BIGENDIAN
390 *((DATA32 *)dst_ptr) = 450 *((DATA32 *)dst_ptr) =
@@ -412,7 +472,9 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src
412 DATA16 *dst_ptr; 472 DATA16 *dst_ptr;
413 int x, y; 473 int x, y;
414 DATA8 r, g, b; 474 DATA8 r, g, b;
475#ifndef BUILD_NO_DITHER_MASK
415 DATA8 dith, dith2; 476 DATA8 dith, dith2;
477#endif
416 478
417 dst_ptr = (DATA16 *)dst; 479 dst_ptr = (DATA16 *)dst;
418 480
@@ -421,11 +483,14 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith (DATA32 *src, DATA8 *dst, int src
421 r = (R_VAL(src_ptr)) >> 3; 483 r = (R_VAL(src_ptr)) >> 3;
422 g = (G_VAL(src_ptr)) >> 2; 484 g = (G_VAL(src_ptr)) >> 2;
423 b = (B_VAL(src_ptr)) >> 3; 485 b = (B_VAL(src_ptr)) >> 3;
486
487#ifndef BUILD_NO_DITHER_MASK
424 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 488 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
425 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 489 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
426 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 490 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
427 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 491 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
428 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 492 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
493#endif
429 494
430 *dst_ptr = (b << 11) | (g << 5) | (r); 495 *dst_ptr = (b << 11) | (g << 5) | (r);
431 496
@@ -446,7 +511,9 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst
446 int x, y; 511 int x, y;
447 DATA8 r1, g1, b1; 512 DATA8 r1, g1, b1;
448 DATA8 r2, g2, b2; 513 DATA8 r2, g2, b2;
514#ifndef BUILD_NO_DITHER_MASK
449 DATA8 dith, dith2; 515 DATA8 dith, dith2;
516#endif
450 517
451 dst_ptr = (DATA16 *)dst; 518 dst_ptr = (DATA16 *)dst;
452 519
@@ -455,22 +522,28 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst
455 r1 = (R_VAL(src_ptr)) >> 3; 522 r1 = (R_VAL(src_ptr)) >> 3;
456 g1 = (G_VAL(src_ptr)) >> 2; 523 g1 = (G_VAL(src_ptr)) >> 2;
457 b1 = (B_VAL(src_ptr)) >> 3; 524 b1 = (B_VAL(src_ptr)) >> 3;
525
526#ifndef BUILD_NO_DITHER_MASK
458 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 527 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
459 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 528 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
460 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 529 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
461 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 530 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
462 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 531 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
532#endif
463 533
464 CONVERT_LOOP2_INC_ROT_180(); 534 CONVERT_LOOP2_INC_ROT_180();
465 535
466 r2 = (R_VAL(src_ptr)) >> 3; 536 r2 = (R_VAL(src_ptr)) >> 3;
467 g2 = (G_VAL(src_ptr)) >> 2; 537 g2 = (G_VAL(src_ptr)) >> 2;
468 b2 = (B_VAL(src_ptr)) >> 3; 538 b2 = (B_VAL(src_ptr)) >> 3;
539
540#ifndef BUILD_NO_DITHER_MASK
469 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 541 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
470 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 542 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
471 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 543 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
472 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 544 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
473 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 545 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
546#endif
474 547
475#ifndef WORDS_BIGENDIAN 548#ifndef WORDS_BIGENDIAN
476 *((DATA32 *)dst_ptr) = 549 *((DATA32 *)dst_ptr) =
@@ -498,7 +571,9 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
498 DATA16 *dst_ptr; 571 DATA16 *dst_ptr;
499 int x, y; 572 int x, y;
500 DATA8 r, g, b; 573 DATA8 r, g, b;
574#ifndef BUILD_NO_DITHER_MASK
501 DATA8 dith, dith2; 575 DATA8 dith, dith2;
576#endif
502 577
503 dst_ptr = (DATA16 *)dst; 578 dst_ptr = (DATA16 *)dst;
504 579
@@ -509,11 +584,14 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_180 (DATA32 *src, DATA8 *dst,
509 r = (R_VAL(src_ptr)) >> 3; 584 r = (R_VAL(src_ptr)) >> 3;
510 g = (G_VAL(src_ptr)) >> 2; 585 g = (G_VAL(src_ptr)) >> 2;
511 b = (B_VAL(src_ptr)) >> 3; 586 b = (B_VAL(src_ptr)) >> 3;
587
588#ifndef BUILD_NO_DITHER_MASK
512 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 589 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
513 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 590 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
514 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 591 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
515 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 592 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
516 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 593 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
594#endif
517 595
518 *dst_ptr = (b << 11) | (g << 5) | (r); 596 *dst_ptr = (b << 11) | (g << 5) | (r);
519 597
@@ -534,7 +612,9 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst
534 int x, y; 612 int x, y;
535 DATA8 r1, g1, b1; 613 DATA8 r1, g1, b1;
536 DATA8 r2, g2, b2; 614 DATA8 r2, g2, b2;
615#ifndef BUILD_NO_DITHER_MASK
537 DATA8 dith, dith2; 616 DATA8 dith, dith2;
617#endif
538 618
539 dst_ptr = (DATA16 *)dst; 619 dst_ptr = (DATA16 *)dst;
540 620
@@ -543,22 +623,28 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst
543 r1 = (R_VAL(src_ptr)) >> 3; 623 r1 = (R_VAL(src_ptr)) >> 3;
544 g1 = (G_VAL(src_ptr)) >> 2; 624 g1 = (G_VAL(src_ptr)) >> 2;
545 b1 = (B_VAL(src_ptr)) >> 3; 625 b1 = (B_VAL(src_ptr)) >> 3;
626
627#ifndef BUILD_NO_DITHER_MASK
546 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 628 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
547 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 629 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
548 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 630 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
549 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 631 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
550 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 632 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
633#endif
551 634
552 CONVERT_LOOP2_INC_ROT_270(); 635 CONVERT_LOOP2_INC_ROT_270();
553 636
554 r2 = (R_VAL(src_ptr)) >> 3; 637 r2 = (R_VAL(src_ptr)) >> 3;
555 g2 = (G_VAL(src_ptr)) >> 2; 638 g2 = (G_VAL(src_ptr)) >> 2;
556 b2 = (B_VAL(src_ptr)) >> 3; 639 b2 = (B_VAL(src_ptr)) >> 3;
640
641#ifndef BUILD_NO_DITHER_MASK
557 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 642 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
558 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 643 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
559 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 644 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
560 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 645 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
561 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 646 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
647#endif
562 648
563#ifndef WORDS_BIGENDIAN 649#ifndef WORDS_BIGENDIAN
564 *((DATA32 *)dst_ptr) = 650 *((DATA32 *)dst_ptr) =
@@ -586,7 +672,9 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst,
586 DATA16 *dst_ptr; 672 DATA16 *dst_ptr;
587 int x, y; 673 int x, y;
588 DATA8 r, g, b; 674 DATA8 r, g, b;
675#ifndef BUILD_NO_DITHER_MASK
589 DATA8 dith, dith2; 676 DATA8 dith, dith2;
677#endif
590 678
591 dst_ptr = (DATA16 *)dst; 679 dst_ptr = (DATA16 *)dst;
592 680
@@ -595,11 +683,14 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_270 (DATA32 *src, DATA8 *dst,
595 r = (R_VAL(src_ptr)) >> 3; 683 r = (R_VAL(src_ptr)) >> 3;
596 g = (G_VAL(src_ptr)) >> 2; 684 g = (G_VAL(src_ptr)) >> 2;
597 b = (B_VAL(src_ptr)) >> 3; 685 b = (B_VAL(src_ptr)) >> 3;
686
687#ifndef BUILD_NO_DITHER_MASK
598 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 688 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
599 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 689 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
600 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 690 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
601 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 691 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
602 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 692 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
693#endif
603 694
604 *dst_ptr = (b << 11) | (g << 5) | (r); 695 *dst_ptr = (b << 11) | (g << 5) | (r);
605 696
@@ -620,7 +711,9 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
620 int x, y; 711 int x, y;
621 DATA8 r1, g1, b1; 712 DATA8 r1, g1, b1;
622 DATA8 r2, g2, b2; 713 DATA8 r2, g2, b2;
714#ifndef BUILD_NO_DITHER_MASK
623 DATA8 dith, dith2; 715 DATA8 dith, dith2;
716#endif
624 717
625 dst_ptr = (DATA16 *)dst; 718 dst_ptr = (DATA16 *)dst;
626 719
@@ -629,22 +722,28 @@ evas_common_convert_rgba2_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
629 r1 = (R_VAL(src_ptr)) >> 3; 722 r1 = (R_VAL(src_ptr)) >> 3;
630 g1 = (G_VAL(src_ptr)) >> 2; 723 g1 = (G_VAL(src_ptr)) >> 2;
631 b1 = (B_VAL(src_ptr)) >> 3; 724 b1 = (B_VAL(src_ptr)) >> 3;
725
726#ifndef BUILD_NO_DITHER_MASK
632 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 727 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
633 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 728 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
634 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++; 729 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith ) && (r1 < 0x1f)) r1++;
635 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++; 730 if (((G_VAL(src_ptr) - (g1 << 2)) >= dith2) && (g1 < 0x3f)) g1++;
636 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++; 731 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith ) && (b1 < 0x1f)) b1++;
732#endif
637 733
638 CONVERT_LOOP2_INC_ROT_90(); 734 CONVERT_LOOP2_INC_ROT_90();
639 735
640 r2 = (R_VAL(src_ptr)) >> 3; 736 r2 = (R_VAL(src_ptr)) >> 3;
641 g2 = (G_VAL(src_ptr)) >> 2; 737 g2 = (G_VAL(src_ptr)) >> 2;
642 b2 = (B_VAL(src_ptr)) >> 3; 738 b2 = (B_VAL(src_ptr)) >> 3;
739
740#ifndef BUILD_NO_DITHER_MASK
643 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 741 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
644 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 742 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
645 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++; 743 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith ) && (r2 < 0x1f)) r2++;
646 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++; 744 if (((G_VAL(src_ptr) - (g2 << 2)) >= dith2) && (g2 < 0x3f)) g2++;
647 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++; 745 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith ) && (b2 < 0x1f)) b2++;
746#endif
648 747
649#ifndef WORDS_BIGENDIAN 748#ifndef WORDS_BIGENDIAN
650 *((DATA32 *)dst_ptr) = 749 *((DATA32 *)dst_ptr) =
@@ -672,7 +771,9 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
672 DATA16 *dst_ptr; 771 DATA16 *dst_ptr;
673 int x, y; 772 int x, y;
674 DATA8 r, g, b; 773 DATA8 r, g, b;
774#ifndef BUILD_NO_DITHER_MASK
675 DATA8 dith, dith2; 775 DATA8 dith, dith2;
776#endif
676 777
677 dst_ptr = (DATA16 *)dst; 778 dst_ptr = (DATA16 *)dst;
678 779
@@ -681,11 +782,14 @@ evas_common_convert_rgba_to_16bpp_bgr_565_dith_rot_90 (DATA32 *src, DATA8 *dst,
681 r = (R_VAL(src_ptr)) >> 3; 782 r = (R_VAL(src_ptr)) >> 3;
682 g = (G_VAL(src_ptr)) >> 2; 783 g = (G_VAL(src_ptr)) >> 2;
683 b = (B_VAL(src_ptr)) >> 3; 784 b = (B_VAL(src_ptr)) >> 3;
785
786#ifndef BUILD_NO_DITHER_MASK
684 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 787 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
685 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6); 788 dith2 = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(6);
686 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++; 789 if (((R_VAL(src_ptr) - (r << 3)) >= dith ) && (r < 0x1f)) r++;
687 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++; 790 if (((G_VAL(src_ptr) - (g << 2)) >= dith2) && (g < 0x3f)) g++;
688 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++; 791 if (((B_VAL(src_ptr) - (b << 3)) >= dith ) && (b < 0x1f)) b++;
792#endif
689 793
690 *dst_ptr = (b << 11) | (g << 5) | (r); 794 *dst_ptr = (b << 11) | (g << 5) | (r);
691 795
@@ -706,7 +810,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int sr
706 int x, y; 810 int x, y;
707 DATA8 r1, g1, b1; 811 DATA8 r1, g1, b1;
708 DATA8 r2, g2, b2; 812 DATA8 r2, g2, b2;
813#ifndef BUILD_NO_DITHER_MASK
709 DATA8 dith; 814 DATA8 dith;
815#endif
710 816
711 dst_ptr = (DATA16 *)dst; 817 dst_ptr = (DATA16 *)dst;
712 818
@@ -715,20 +821,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int sr
715 r1 = (R_VAL(src_ptr)) >> 4; 821 r1 = (R_VAL(src_ptr)) >> 4;
716 g1 = (G_VAL(src_ptr)) >> 4; 822 g1 = (G_VAL(src_ptr)) >> 4;
717 b1 = (B_VAL(src_ptr)) >> 4; 823 b1 = (B_VAL(src_ptr)) >> 4;
824
825#ifndef BUILD_NO_DITHER_MASK
718 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 826 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
719 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 827 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
720 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 828 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
721 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 829 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
830#endif
722 831
723 CONVERT_LOOP2_INC_ROT_0(); 832 CONVERT_LOOP2_INC_ROT_0();
724 833
725 r2 = (R_VAL(src_ptr)) >> 4; 834 r2 = (R_VAL(src_ptr)) >> 4;
726 g2 = (G_VAL(src_ptr)) >> 4; 835 g2 = (G_VAL(src_ptr)) >> 4;
727 b2 = (B_VAL(src_ptr)) >> 4; 836 b2 = (B_VAL(src_ptr)) >> 4;
837
838#ifndef BUILD_NO_DITHER_MASK
728 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 839 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
729 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 840 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
730 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 841 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
731 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 842 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
843#endif
732 844
733#ifndef WORDS_BIGENDIAN 845#ifndef WORDS_BIGENDIAN
734 *((DATA32 *)dst_ptr) = 846 *((DATA32 *)dst_ptr) =
@@ -756,7 +868,9 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src
756 DATA16 *dst_ptr; 868 DATA16 *dst_ptr;
757 int x, y; 869 int x, y;
758 DATA8 r, g, b; 870 DATA8 r, g, b;
871#ifndef BUILD_NO_DITHER_MASK
759 DATA8 dith; 872 DATA8 dith;
873#endif
760 874
761 dst_ptr = (DATA16 *)dst; 875 dst_ptr = (DATA16 *)dst;
762 876
@@ -765,10 +879,13 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith (DATA32 *src, DATA8 *dst, int src
765 r = (R_VAL(src_ptr)) >> 4; 879 r = (R_VAL(src_ptr)) >> 4;
766 g = (G_VAL(src_ptr)) >> 4; 880 g = (G_VAL(src_ptr)) >> 4;
767 b = (B_VAL(src_ptr)) >> 4; 881 b = (B_VAL(src_ptr)) >> 4;
882
883#ifndef BUILD_NO_DITHER_MASK
768 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 884 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
769 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 885 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
770 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 886 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
771 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 887 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
888#endif
772 889
773 *dst_ptr = (r << 8) | (g << 4) | (b); 890 *dst_ptr = (r << 8) | (g << 4) | (b);
774 891
@@ -789,7 +906,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst
789 int x, y; 906 int x, y;
790 DATA8 r1, g1, b1; 907 DATA8 r1, g1, b1;
791 DATA8 r2, g2, b2; 908 DATA8 r2, g2, b2;
909#ifndef BUILD_NO_DITHER_MASK
792 DATA8 dith; 910 DATA8 dith;
911#endif
793 912
794 dst_ptr = (DATA16 *)dst; 913 dst_ptr = (DATA16 *)dst;
795 914
@@ -798,20 +917,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst
798 r1 = (R_VAL(src_ptr)) >> 4; 917 r1 = (R_VAL(src_ptr)) >> 4;
799 g1 = (G_VAL(src_ptr)) >> 4; 918 g1 = (G_VAL(src_ptr)) >> 4;
800 b1 = (B_VAL(src_ptr)) >> 4; 919 b1 = (B_VAL(src_ptr)) >> 4;
920
921#ifndef BUILD_NO_DITHER_MASK
801 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 922 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
802 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 923 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
803 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 924 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
804 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 925 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
926#endif
805 927
806 CONVERT_LOOP2_INC_ROT_180(); 928 CONVERT_LOOP2_INC_ROT_180();
807 929
808 r2 = (R_VAL(src_ptr)) >> 4; 930 r2 = (R_VAL(src_ptr)) >> 4;
809 g2 = (G_VAL(src_ptr)) >> 4; 931 g2 = (G_VAL(src_ptr)) >> 4;
810 b2 = (B_VAL(src_ptr)) >> 4; 932 b2 = (B_VAL(src_ptr)) >> 4;
933
934#ifndef BUILD_NO_DITHER_MASK
811 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 935 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
812 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 936 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
813 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 937 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
814 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 938 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
939#endif
815 940
816#ifndef WORDS_BIGENDIAN 941#ifndef WORDS_BIGENDIAN
817 *((DATA32 *)dst_ptr) = 942 *((DATA32 *)dst_ptr) =
@@ -839,7 +964,9 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst,
839 DATA16 *dst_ptr; 964 DATA16 *dst_ptr;
840 int x, y; 965 int x, y;
841 DATA8 r, g, b; 966 DATA8 r, g, b;
967#ifndef BUILD_NO_DITHER_MASK
842 DATA8 dith; 968 DATA8 dith;
969#endif
843 970
844 dst_ptr = (DATA16 *)dst; 971 dst_ptr = (DATA16 *)dst;
845 972
@@ -848,10 +975,13 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_180 (DATA32 *src, DATA8 *dst,
848 r = (R_VAL(src_ptr)) >> 4; 975 r = (R_VAL(src_ptr)) >> 4;
849 g = (G_VAL(src_ptr)) >> 4; 976 g = (G_VAL(src_ptr)) >> 4;
850 b = (B_VAL(src_ptr)) >> 4; 977 b = (B_VAL(src_ptr)) >> 4;
978
979#ifndef BUILD_NO_DITHER_MASK
851 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 980 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
852 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 981 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
853 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 982 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
854 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 983 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
984#endif
855 985
856 *dst_ptr = (r << 8) | (g << 4) | (b); 986 *dst_ptr = (r << 8) | (g << 4) | (b);
857 987
@@ -872,7 +1002,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst
872 int x, y; 1002 int x, y;
873 DATA8 r1, g1, b1; 1003 DATA8 r1, g1, b1;
874 DATA8 r2, g2, b2; 1004 DATA8 r2, g2, b2;
1005#ifndef BUILD_NO_DITHER_MASK
875 DATA8 dith; 1006 DATA8 dith;
1007#endif
876 1008
877 dst_ptr = (DATA16 *)dst; 1009 dst_ptr = (DATA16 *)dst;
878 1010
@@ -881,20 +1013,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst
881 r1 = (R_VAL(src_ptr)) >> 4; 1013 r1 = (R_VAL(src_ptr)) >> 4;
882 g1 = (G_VAL(src_ptr)) >> 4; 1014 g1 = (G_VAL(src_ptr)) >> 4;
883 b1 = (B_VAL(src_ptr)) >> 4; 1015 b1 = (B_VAL(src_ptr)) >> 4;
1016
1017#ifndef BUILD_NO_DITHER_MASK
884 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1018 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
885 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1019 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
886 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1020 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
887 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1021 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1022#endif
888 1023
889 CONVERT_LOOP2_INC_ROT_270(); 1024 CONVERT_LOOP2_INC_ROT_270();
890 1025
891 r2 = (R_VAL(src_ptr)) >> 4; 1026 r2 = (R_VAL(src_ptr)) >> 4;
892 g2 = (G_VAL(src_ptr)) >> 4; 1027 g2 = (G_VAL(src_ptr)) >> 4;
893 b2 = (B_VAL(src_ptr)) >> 4; 1028 b2 = (B_VAL(src_ptr)) >> 4;
1029
1030#ifndef BUILD_NO_DITHER_MASK
894 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1031 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
895 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1032 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
896 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1033 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
897 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1034 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1035#endif
898 1036
899#ifndef WORDS_BIGENDIAN 1037#ifndef WORDS_BIGENDIAN
900 *((DATA32 *)dst_ptr) = 1038 *((DATA32 *)dst_ptr) =
@@ -922,7 +1060,9 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst,
922 DATA16 *dst_ptr; 1060 DATA16 *dst_ptr;
923 int x, y; 1061 int x, y;
924 DATA8 r, g, b; 1062 DATA8 r, g, b;
1063#ifndef BUILD_NO_DITHER_MASK
925 DATA8 dith; 1064 DATA8 dith;
1065#endif
926 1066
927 dst_ptr = (DATA16 *)dst; 1067 dst_ptr = (DATA16 *)dst;
928 1068
@@ -931,10 +1071,13 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_270 (DATA32 *src, DATA8 *dst,
931 r = (R_VAL(src_ptr)) >> 4; 1071 r = (R_VAL(src_ptr)) >> 4;
932 g = (G_VAL(src_ptr)) >> 4; 1072 g = (G_VAL(src_ptr)) >> 4;
933 b = (B_VAL(src_ptr)) >> 4; 1073 b = (B_VAL(src_ptr)) >> 4;
1074
1075#ifndef BUILD_NO_DITHER_MASK
934 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1076 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
935 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1077 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
936 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1078 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
937 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1079 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1080#endif
938 1081
939 *dst_ptr = (r << 8) | (g << 4) | (b); 1082 *dst_ptr = (r << 8) | (g << 4) | (b);
940 1083
@@ -955,7 +1098,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst,
955 int x, y; 1098 int x, y;
956 DATA8 r1, g1, b1; 1099 DATA8 r1, g1, b1;
957 DATA8 r2, g2, b2; 1100 DATA8 r2, g2, b2;
1101#ifndef BUILD_NO_DITHER_MASK
958 DATA8 dith; 1102 DATA8 dith;
1103#endif
959 1104
960 dst_ptr = (DATA16 *)dst; 1105 dst_ptr = (DATA16 *)dst;
961 1106
@@ -964,20 +1109,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst,
964 r1 = (R_VAL(src_ptr)) >> 4; 1109 r1 = (R_VAL(src_ptr)) >> 4;
965 g1 = (G_VAL(src_ptr)) >> 4; 1110 g1 = (G_VAL(src_ptr)) >> 4;
966 b1 = (B_VAL(src_ptr)) >> 4; 1111 b1 = (B_VAL(src_ptr)) >> 4;
1112
1113#ifndef BUILD_NO_DITHER_MASK
967 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1114 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
968 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1115 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
969 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1116 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
970 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1117 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1118#endif
971 1119
972 CONVERT_LOOP2_INC_ROT_90(); 1120 CONVERT_LOOP2_INC_ROT_90();
973 1121
974 r2 = (R_VAL(src_ptr)) >> 4; 1122 r2 = (R_VAL(src_ptr)) >> 4;
975 g2 = (G_VAL(src_ptr)) >> 4; 1123 g2 = (G_VAL(src_ptr)) >> 4;
976 b2 = (B_VAL(src_ptr)) >> 4; 1124 b2 = (B_VAL(src_ptr)) >> 4;
1125
1126#ifndef BUILD_NO_DITHER_MASK
977 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1127 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
978 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1128 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
979 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1129 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
980 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1130 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1131#endif
981 1132
982#ifndef WORDS_BIGENDIAN 1133#ifndef WORDS_BIGENDIAN
983 *((DATA32 *)dst_ptr) = 1134 *((DATA32 *)dst_ptr) =
@@ -1005,7 +1156,9 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst,
1005 DATA16 *dst_ptr; 1156 DATA16 *dst_ptr;
1006 int x, y; 1157 int x, y;
1007 DATA8 r, g, b; 1158 DATA8 r, g, b;
1159#ifndef BUILD_NO_DITHER_MASK
1008 DATA8 dith; 1160 DATA8 dith;
1161#endif
1009 1162
1010 dst_ptr = (DATA16 *)dst; 1163 dst_ptr = (DATA16 *)dst;
1011 1164
@@ -1014,10 +1167,13 @@ evas_common_convert_rgba_to_16bpp_rgb_444_dith_rot_90 (DATA32 *src, DATA8 *dst,
1014 r = (R_VAL(src_ptr)) >> 4; 1167 r = (R_VAL(src_ptr)) >> 4;
1015 g = (G_VAL(src_ptr)) >> 4; 1168 g = (G_VAL(src_ptr)) >> 4;
1016 b = (B_VAL(src_ptr)) >> 4; 1169 b = (B_VAL(src_ptr)) >> 4;
1170
1171#ifndef BUILD_NO_DITHER_MASK
1017 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1172 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1018 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1173 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1019 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1174 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1020 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1175 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1176#endif
1021 1177
1022 *dst_ptr = (r << 8) | (g << 4) | (b); 1178 *dst_ptr = (r << 8) | (g << 4) | (b);
1023 1179
@@ -1038,7 +1194,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int
1038 int x, y; 1194 int x, y;
1039 DATA8 r1, g1, b1; 1195 DATA8 r1, g1, b1;
1040 DATA8 r2, g2, b2; 1196 DATA8 r2, g2, b2;
1197#ifndef BUILD_NO_DITHER_MASK
1041 DATA8 dith; 1198 DATA8 dith;
1199#endif
1042 1200
1043 dst_ptr = (DATA16 *)dst; 1201 dst_ptr = (DATA16 *)dst;
1044 1202
@@ -1047,20 +1205,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int
1047 r1 = (R_VAL(src_ptr)) >> 4; 1205 r1 = (R_VAL(src_ptr)) >> 4;
1048 g1 = (G_VAL(src_ptr)) >> 4; 1206 g1 = (G_VAL(src_ptr)) >> 4;
1049 b1 = (B_VAL(src_ptr)) >> 4; 1207 b1 = (B_VAL(src_ptr)) >> 4;
1208
1209#ifndef BUILD_NO_DITHER_MASK
1050 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1210 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1051 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1211 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1052 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1212 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1053 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1213 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1214#endif
1054 1215
1055 CONVERT_LOOP2_INC_ROT_0(); 1216 CONVERT_LOOP2_INC_ROT_0();
1056 1217
1057 r2 = (R_VAL(src_ptr)) >> 4; 1218 r2 = (R_VAL(src_ptr)) >> 4;
1058 g2 = (G_VAL(src_ptr)) >> 4; 1219 g2 = (G_VAL(src_ptr)) >> 4;
1059 b2 = (B_VAL(src_ptr)) >> 4; 1220 b2 = (B_VAL(src_ptr)) >> 4;
1221
1222#ifndef BUILD_NO_DITHER_MASK
1060 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1223 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1061 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1224 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1062 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1225 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1063 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1226 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1227#endif
1064 1228
1065#ifndef WORDS_BIGENDIAN 1229#ifndef WORDS_BIGENDIAN
1066 *((DATA32 *)dst_ptr) = 1230 *((DATA32 *)dst_ptr) =
@@ -1088,7 +1252,9 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int
1088 DATA16 *dst_ptr; 1252 DATA16 *dst_ptr;
1089 int x, y; 1253 int x, y;
1090 DATA8 r, g, b; 1254 DATA8 r, g, b;
1255#ifndef BUILD_NO_DITHER_MASK
1091 DATA8 dith; 1256 DATA8 dith;
1257#endif
1092 1258
1093 dst_ptr = (DATA16 *)dst; 1259 dst_ptr = (DATA16 *)dst;
1094 1260
@@ -1097,10 +1263,13 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith (DATA32 *src, DATA8 *dst, int
1097 r = (R_VAL(src_ptr)) >> 4; 1263 r = (R_VAL(src_ptr)) >> 4;
1098 g = (G_VAL(src_ptr)) >> 4; 1264 g = (G_VAL(src_ptr)) >> 4;
1099 b = (B_VAL(src_ptr)) >> 4; 1265 b = (B_VAL(src_ptr)) >> 4;
1266
1267#ifndef BUILD_NO_DITHER_MASK
1100 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1268 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1101 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1269 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1102 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1270 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1103 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1271 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1272#endif
1104 1273
1105 *dst_ptr = (r << 12) | (g << 7) | (b << 1); 1274 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1106 1275
@@ -1121,7 +1290,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *
1121 int x, y; 1290 int x, y;
1122 DATA8 r1, g1, b1; 1291 DATA8 r1, g1, b1;
1123 DATA8 r2, g2, b2; 1292 DATA8 r2, g2, b2;
1293#ifndef BUILD_NO_DITHER_MASK
1124 DATA8 dith; 1294 DATA8 dith;
1295#endif
1125 1296
1126 dst_ptr = (DATA16 *)dst; 1297 dst_ptr = (DATA16 *)dst;
1127 1298
@@ -1130,20 +1301,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *
1130 r1 = (R_VAL(src_ptr)) >> 4; 1301 r1 = (R_VAL(src_ptr)) >> 4;
1131 g1 = (G_VAL(src_ptr)) >> 4; 1302 g1 = (G_VAL(src_ptr)) >> 4;
1132 b1 = (B_VAL(src_ptr)) >> 4; 1303 b1 = (B_VAL(src_ptr)) >> 4;
1304
1305#ifndef BUILD_NO_DITHER_MASK
1133 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1306 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1134 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1307 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1135 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1308 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1136 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1309 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1310#endif
1137 1311
1138 CONVERT_LOOP2_INC_ROT_180(); 1312 CONVERT_LOOP2_INC_ROT_180();
1139 1313
1140 r2 = (R_VAL(src_ptr)) >> 4; 1314 r2 = (R_VAL(src_ptr)) >> 4;
1141 g2 = (G_VAL(src_ptr)) >> 4; 1315 g2 = (G_VAL(src_ptr)) >> 4;
1142 b2 = (B_VAL(src_ptr)) >> 4; 1316 b2 = (B_VAL(src_ptr)) >> 4;
1317
1318#ifndef BUILD_NO_DITHER_MASK
1143 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1319 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1144 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1320 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1145 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1321 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1146 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1322 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1323#endif
1147 1324
1148#ifndef WORDS_BIGENDIAN 1325#ifndef WORDS_BIGENDIAN
1149 *((DATA32 *)dst_ptr) = 1326 *((DATA32 *)dst_ptr) =
@@ -1171,7 +1348,9 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *d
1171 DATA16 *dst_ptr; 1348 DATA16 *dst_ptr;
1172 int x, y; 1349 int x, y;
1173 DATA8 r, g, b; 1350 DATA8 r, g, b;
1351#ifndef BUILD_NO_DITHER_MASK
1174 DATA8 dith; 1352 DATA8 dith;
1353#endif
1175 1354
1176 dst_ptr = (DATA16 *)dst; 1355 dst_ptr = (DATA16 *)dst;
1177 1356
@@ -1180,10 +1359,13 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_180 (DATA32 *src, DATA8 *d
1180 r = (R_VAL(src_ptr)) >> 4; 1359 r = (R_VAL(src_ptr)) >> 4;
1181 g = (G_VAL(src_ptr)) >> 4; 1360 g = (G_VAL(src_ptr)) >> 4;
1182 b = (B_VAL(src_ptr)) >> 4; 1361 b = (B_VAL(src_ptr)) >> 4;
1362
1363#ifndef BUILD_NO_DITHER_MASK
1183 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1364 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1184 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1365 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1185 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1366 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1186 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1367 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1368#endif
1187 1369
1188 *dst_ptr = (r << 12) | (g << 7) | (b << 1); 1370 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1189 1371
@@ -1205,7 +1387,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *
1205 int x, y; 1387 int x, y;
1206 DATA8 r1, g1, b1; 1388 DATA8 r1, g1, b1;
1207 DATA8 r2, g2, b2; 1389 DATA8 r2, g2, b2;
1390#ifndef BUILD_NO_DITHER_MASK
1208 DATA8 dith; 1391 DATA8 dith;
1392#endif
1209 1393
1210 dst_ptr = (DATA16 *)dst; 1394 dst_ptr = (DATA16 *)dst;
1211 1395
@@ -1214,20 +1398,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *
1214 r1 = (R_VAL(src_ptr)) >> 4; 1398 r1 = (R_VAL(src_ptr)) >> 4;
1215 g1 = (G_VAL(src_ptr)) >> 4; 1399 g1 = (G_VAL(src_ptr)) >> 4;
1216 b1 = (B_VAL(src_ptr)) >> 4; 1400 b1 = (B_VAL(src_ptr)) >> 4;
1401
1402#ifndef BUILD_NO_DITHER_MASK
1217 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1403 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1218 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1404 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1219 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1405 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1220 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1406 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1407#endif
1221 1408
1222 CONVERT_LOOP2_INC_ROT_270(); 1409 CONVERT_LOOP2_INC_ROT_270();
1223 1410
1224 r2 = (R_VAL(src_ptr)) >> 4; 1411 r2 = (R_VAL(src_ptr)) >> 4;
1225 g2 = (G_VAL(src_ptr)) >> 4; 1412 g2 = (G_VAL(src_ptr)) >> 4;
1226 b2 = (B_VAL(src_ptr)) >> 4; 1413 b2 = (B_VAL(src_ptr)) >> 4;
1414
1415#ifndef BUILD_NO_DITHER_MASK
1227 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1416 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1228 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1417 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1229 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1418 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1230 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1419 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1420#endif
1231 1421
1232#ifndef WORDS_BIGENDIAN 1422#ifndef WORDS_BIGENDIAN
1233 *((DATA32 *)dst_ptr) = 1423 *((DATA32 *)dst_ptr) =
@@ -1255,7 +1445,9 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *d
1255 DATA16 *dst_ptr; 1445 DATA16 *dst_ptr;
1256 int x, y; 1446 int x, y;
1257 DATA8 r, g, b; 1447 DATA8 r, g, b;
1448#ifndef BUILD_NO_DITHER_MASK
1258 DATA8 dith; 1449 DATA8 dith;
1450#endif
1259 1451
1260 dst_ptr = (DATA16 *)dst; 1452 dst_ptr = (DATA16 *)dst;
1261 1453
@@ -1264,10 +1456,13 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_270 (DATA32 *src, DATA8 *d
1264 r = (R_VAL(src_ptr)) >> 4; 1456 r = (R_VAL(src_ptr)) >> 4;
1265 g = (G_VAL(src_ptr)) >> 4; 1457 g = (G_VAL(src_ptr)) >> 4;
1266 b = (B_VAL(src_ptr)) >> 4; 1458 b = (B_VAL(src_ptr)) >> 4;
1459
1460#ifndef BUILD_NO_DITHER_MASK
1267 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1461 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1268 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1462 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1269 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1463 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1270 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1464 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1465#endif
1271 1466
1272 *dst_ptr = (r << 12) | (g << 7) | (b << 1); 1467 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1273 1468
@@ -1288,7 +1483,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *d
1288 int x, y; 1483 int x, y;
1289 DATA8 r1, g1, b1; 1484 DATA8 r1, g1, b1;
1290 DATA8 r2, g2, b2; 1485 DATA8 r2, g2, b2;
1486#ifndef BUILD_NO_DITHER_MASK
1291 DATA8 dith; 1487 DATA8 dith;
1488#endif
1292 1489
1293 dst_ptr = (DATA16 *)dst; 1490 dst_ptr = (DATA16 *)dst;
1294 1491
@@ -1297,20 +1494,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *d
1297 r1 = (R_VAL(src_ptr)) >> 4; 1494 r1 = (R_VAL(src_ptr)) >> 4;
1298 g1 = (G_VAL(src_ptr)) >> 4; 1495 g1 = (G_VAL(src_ptr)) >> 4;
1299 b1 = (B_VAL(src_ptr)) >> 4; 1496 b1 = (B_VAL(src_ptr)) >> 4;
1497
1498#ifndef BUILD_NO_DITHER_MASK
1300 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1499 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1301 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++; 1500 if (((R_VAL(src_ptr) - (r1 << 4)) >= dith ) && (r1 < 0x0f)) r1++;
1302 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++; 1501 if (((G_VAL(src_ptr) - (g1 << 4)) >= dith ) && (g1 < 0x0f)) g1++;
1303 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++; 1502 if (((B_VAL(src_ptr) - (b1 << 4)) >= dith ) && (b1 < 0x0f)) b1++;
1503#endif
1304 1504
1305 CONVERT_LOOP2_INC_ROT_90(); 1505 CONVERT_LOOP2_INC_ROT_90();
1306 1506
1307 r2 = (R_VAL(src_ptr)) >> 4; 1507 r2 = (R_VAL(src_ptr)) >> 4;
1308 g2 = (G_VAL(src_ptr)) >> 4; 1508 g2 = (G_VAL(src_ptr)) >> 4;
1309 b2 = (B_VAL(src_ptr)) >> 4; 1509 b2 = (B_VAL(src_ptr)) >> 4;
1510
1511#ifndef BUILD_NO_DITHER_MASK
1310 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1512 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1311 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++; 1513 if (((R_VAL(src_ptr) - (r2 << 4)) >= dith ) && (r2 < 0x0f)) r2++;
1312 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++; 1514 if (((G_VAL(src_ptr) - (g2 << 4)) >= dith ) && (g2 < 0x0f)) g2++;
1313 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++; 1515 if (((B_VAL(src_ptr) - (b2 << 4)) >= dith ) && (b2 < 0x0f)) b2++;
1516#endif
1314 1517
1315#ifndef WORDS_BIGENDIAN 1518#ifndef WORDS_BIGENDIAN
1316 *((DATA32 *)dst_ptr) = 1519 *((DATA32 *)dst_ptr) =
@@ -1338,7 +1541,9 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *ds
1338 DATA16 *dst_ptr; 1541 DATA16 *dst_ptr;
1339 int x, y; 1542 int x, y;
1340 DATA8 r, g, b; 1543 DATA8 r, g, b;
1544#ifndef BUILD_NO_DITHER_MASK
1341 DATA8 dith; 1545 DATA8 dith;
1546#endif
1342 1547
1343 dst_ptr = (DATA16 *)dst; 1548 dst_ptr = (DATA16 *)dst;
1344 1549
@@ -1347,10 +1552,13 @@ evas_common_convert_rgba_to_16bpp_rgb_454645_dith_rot_90 (DATA32 *src, DATA8 *ds
1347 r = (R_VAL(src_ptr)) >> 4; 1552 r = (R_VAL(src_ptr)) >> 4;
1348 g = (G_VAL(src_ptr)) >> 4; 1553 g = (G_VAL(src_ptr)) >> 4;
1349 b = (B_VAL(src_ptr)) >> 4; 1554 b = (B_VAL(src_ptr)) >> 4;
1555
1556#ifndef BUILD_NO_DITHER_MASK
1350 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4); 1557 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(4);
1351 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++; 1558 if (((R_VAL(src_ptr) - (r << 4)) >= dith ) && (r < 0x0f)) r++;
1352 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++; 1559 if (((G_VAL(src_ptr) - (g << 4)) >= dith ) && (g < 0x0f)) g++;
1353 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++; 1560 if (((B_VAL(src_ptr) - (b << 4)) >= dith ) && (b < 0x0f)) b++;
1561#endif
1354 1562
1355 *dst_ptr = (r << 12) | (g << 7) | (b << 1); 1563 *dst_ptr = (r << 12) | (g << 7) | (b << 1);
1356 1564
@@ -1371,7 +1579,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int sr
1371 int x, y; 1579 int x, y;
1372 DATA8 r1, g1, b1; 1580 DATA8 r1, g1, b1;
1373 DATA8 r2, g2, b2; 1581 DATA8 r2, g2, b2;
1582#ifndef BUILD_NO_DITHER_MASK
1374 DATA8 dith; 1583 DATA8 dith;
1584#endif
1375 1585
1376 dst_ptr = (DATA16 *)dst; 1586 dst_ptr = (DATA16 *)dst;
1377 1587
@@ -1380,20 +1590,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int sr
1380 r1 = (R_VAL(src_ptr)) >> 3; 1590 r1 = (R_VAL(src_ptr)) >> 3;
1381 g1 = (G_VAL(src_ptr)) >> 3; 1591 g1 = (G_VAL(src_ptr)) >> 3;
1382 b1 = (B_VAL(src_ptr)) >> 3; 1592 b1 = (B_VAL(src_ptr)) >> 3;
1593
1594#ifndef BUILD_NO_DITHER_MASK
1383 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1595 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1384 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++; 1596 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1385 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++; 1597 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1386 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++; 1598 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1599#endif
1387 1600
1388 CONVERT_LOOP2_INC_ROT_0(); 1601 CONVERT_LOOP2_INC_ROT_0();
1389 1602
1390 r2 = (R_VAL(src_ptr)) >> 3; 1603 r2 = (R_VAL(src_ptr)) >> 3;
1391 g2 = (G_VAL(src_ptr)) >> 3; 1604 g2 = (G_VAL(src_ptr)) >> 3;
1392 b2 = (B_VAL(src_ptr)) >> 3; 1605 b2 = (B_VAL(src_ptr)) >> 3;
1606
1607#ifndef BUILD_NO_DITHER_MASK
1393 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1608 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1394 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++; 1609 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1395 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++; 1610 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1396 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++; 1611 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1612#endif
1397 1613
1398#ifndef WORDS_BIGENDIAN 1614#ifndef WORDS_BIGENDIAN
1399 *((DATA32 *)dst_ptr) = 1615 *((DATA32 *)dst_ptr) =
@@ -1421,7 +1637,9 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src
1421 DATA16 *dst_ptr; 1637 DATA16 *dst_ptr;
1422 int x, y; 1638 int x, y;
1423 DATA8 r, g, b; 1639 DATA8 r, g, b;
1640#ifndef BUILD_NO_DITHER_MASK
1424 DATA8 dith; 1641 DATA8 dith;
1642#endif
1425 1643
1426 dst_ptr = (DATA16 *)dst; 1644 dst_ptr = (DATA16 *)dst;
1427 1645
@@ -1430,10 +1648,13 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith (DATA32 *src, DATA8 *dst, int src
1430 r = (R_VAL(src_ptr)) >> 3; 1648 r = (R_VAL(src_ptr)) >> 3;
1431 g = (G_VAL(src_ptr)) >> 3; 1649 g = (G_VAL(src_ptr)) >> 3;
1432 b = (B_VAL(src_ptr)) >> 3; 1650 b = (B_VAL(src_ptr)) >> 3;
1651
1652#ifndef BUILD_NO_DITHER_MASK
1433 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1653 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1434 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++; 1654 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1435 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++; 1655 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1436 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++; 1656 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1657#endif
1437 1658
1438 *dst_ptr = (r << 10) | (g << 5) | (b); 1659 *dst_ptr = (r << 10) | (g << 5) | (b);
1439 1660
@@ -1454,7 +1675,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst
1454 int x, y; 1675 int x, y;
1455 DATA8 r1, g1, b1; 1676 DATA8 r1, g1, b1;
1456 DATA8 r2, g2, b2; 1677 DATA8 r2, g2, b2;
1678#ifndef BUILD_NO_DITHER_MASK
1457 DATA8 dith; 1679 DATA8 dith;
1680#endif
1458 1681
1459 dst_ptr = (DATA16 *)dst; 1682 dst_ptr = (DATA16 *)dst;
1460 1683
@@ -1463,20 +1686,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst
1463 r1 = (R_VAL(src_ptr)) >> 3; 1686 r1 = (R_VAL(src_ptr)) >> 3;
1464 g1 = (G_VAL(src_ptr)) >> 3; 1687 g1 = (G_VAL(src_ptr)) >> 3;
1465 b1 = (B_VAL(src_ptr)) >> 3; 1688 b1 = (B_VAL(src_ptr)) >> 3;
1689
1690#ifndef BUILD_NO_DITHER_MASK
1466 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1691 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1467 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++; 1692 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1468 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++; 1693 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1469 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++; 1694 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1695#endif
1470 1696
1471 CONVERT_LOOP2_INC_ROT_180(); 1697 CONVERT_LOOP2_INC_ROT_180();
1472 1698
1473 r2 = (R_VAL(src_ptr)) >> 3; 1699 r2 = (R_VAL(src_ptr)) >> 3;
1474 g2 = (G_VAL(src_ptr)) >> 3; 1700 g2 = (G_VAL(src_ptr)) >> 3;
1475 b2 = (B_VAL(src_ptr)) >> 3; 1701 b2 = (B_VAL(src_ptr)) >> 3;
1702
1703#ifndef BUILD_NO_DITHER_MASK
1476 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1704 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1477 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++; 1705 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1478 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++; 1706 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1479 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++; 1707 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1708#endif
1480 1709
1481#ifndef WORDS_BIGENDIAN 1710#ifndef WORDS_BIGENDIAN
1482 *((DATA32 *)dst_ptr) = 1711 *((DATA32 *)dst_ptr) =
@@ -1504,7 +1733,9 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst,
1504 DATA16 *dst_ptr; 1733 DATA16 *dst_ptr;
1505 int x, y; 1734 int x, y;
1506 DATA8 r, g, b; 1735 DATA8 r, g, b;
1736#ifndef BUILD_NO_DITHER_MASK
1507 DATA8 dith; 1737 DATA8 dith;
1738#endif
1508 1739
1509 dst_ptr = (DATA16 *)dst; 1740 dst_ptr = (DATA16 *)dst;
1510 1741
@@ -1513,10 +1744,13 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_180 (DATA32 *src, DATA8 *dst,
1513 r = (R_VAL(src_ptr)) >> 3; 1744 r = (R_VAL(src_ptr)) >> 3;
1514 g = (G_VAL(src_ptr)) >> 3; 1745 g = (G_VAL(src_ptr)) >> 3;
1515 b = (B_VAL(src_ptr)) >> 3; 1746 b = (B_VAL(src_ptr)) >> 3;
1747
1748#ifndef BUILD_NO_DITHER_MASK
1516 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1749 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1517 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++; 1750 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1518 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++; 1751 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1519 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++; 1752 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1753#endif
1520 1754
1521 *dst_ptr = (r << 10) | (g << 5) | (b); 1755 *dst_ptr = (r << 10) | (g << 5) | (b);
1522 1756
@@ -1537,7 +1771,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst
1537 int x, y; 1771 int x, y;
1538 DATA8 r1, g1, b1; 1772 DATA8 r1, g1, b1;
1539 DATA8 r2, g2, b2; 1773 DATA8 r2, g2, b2;
1774#ifndef BUILD_NO_DITHER_MASK
1540 DATA8 dith; 1775 DATA8 dith;
1776#endif
1541 1777
1542 dst_ptr = (DATA16 *)dst; 1778 dst_ptr = (DATA16 *)dst;
1543 1779
@@ -1546,20 +1782,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst
1546 r1 = (R_VAL(src_ptr)) >> 3; 1782 r1 = (R_VAL(src_ptr)) >> 3;
1547 g1 = (G_VAL(src_ptr)) >> 3; 1783 g1 = (G_VAL(src_ptr)) >> 3;
1548 b1 = (B_VAL(src_ptr)) >> 3; 1784 b1 = (B_VAL(src_ptr)) >> 3;
1785
1786#ifndef BUILD_NO_DITHER_MASK
1549 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1787 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1550 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++; 1788 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1551 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++; 1789 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1552 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++; 1790 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1791#endif
1553 1792
1554 CONVERT_LOOP2_INC_ROT_270(); 1793 CONVERT_LOOP2_INC_ROT_270();
1555 1794
1556 r2 = (R_VAL(src_ptr)) >> 3; 1795 r2 = (R_VAL(src_ptr)) >> 3;
1557 g2 = (G_VAL(src_ptr)) >> 3; 1796 g2 = (G_VAL(src_ptr)) >> 3;
1558 b2 = (B_VAL(src_ptr)) >> 3; 1797 b2 = (B_VAL(src_ptr)) >> 3;
1798
1799#ifndef BUILD_NO_DITHER_MASK
1559 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1800 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1560 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++; 1801 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1561 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++; 1802 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1562 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++; 1803 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1804#endif
1563 1805
1564#ifndef WORDS_BIGENDIAN 1806#ifndef WORDS_BIGENDIAN
1565 *((DATA32 *)dst_ptr) = 1807 *((DATA32 *)dst_ptr) =
@@ -1587,7 +1829,9 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst,
1587 DATA16 *dst_ptr; 1829 DATA16 *dst_ptr;
1588 int x, y; 1830 int x, y;
1589 DATA8 r, g, b; 1831 DATA8 r, g, b;
1832#ifndef BUILD_NO_DITHER_MASK
1590 DATA8 dith; 1833 DATA8 dith;
1834#endif
1591 1835
1592 dst_ptr = (DATA16 *)dst; 1836 dst_ptr = (DATA16 *)dst;
1593 1837
@@ -1596,10 +1840,13 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_270 (DATA32 *src, DATA8 *dst,
1596 r = (R_VAL(src_ptr)) >> 3; 1840 r = (R_VAL(src_ptr)) >> 3;
1597 g = (G_VAL(src_ptr)) >> 3; 1841 g = (G_VAL(src_ptr)) >> 3;
1598 b = (B_VAL(src_ptr)) >> 3; 1842 b = (B_VAL(src_ptr)) >> 3;
1843
1844#ifndef BUILD_NO_DITHER_MASK
1599 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1845 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1600 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++; 1846 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1601 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++; 1847 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1602 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++; 1848 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1849#endif
1603 1850
1604 *dst_ptr = (r << 10) | (g << 5) | (b); 1851 *dst_ptr = (r << 10) | (g << 5) | (b);
1605 1852
@@ -1620,7 +1867,9 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst,
1620 int x, y; 1867 int x, y;
1621 DATA8 r1, g1, b1; 1868 DATA8 r1, g1, b1;
1622 DATA8 r2, g2, b2; 1869 DATA8 r2, g2, b2;
1870#ifndef BUILD_NO_DITHER_MASK
1623 DATA8 dith; 1871 DATA8 dith;
1872#endif
1624 1873
1625 dst_ptr = (DATA16 *)dst; 1874 dst_ptr = (DATA16 *)dst;
1626 1875
@@ -1629,20 +1878,26 @@ evas_common_convert_rgba2_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst,
1629 r1 = (R_VAL(src_ptr)) >> 3; 1878 r1 = (R_VAL(src_ptr)) >> 3;
1630 g1 = (G_VAL(src_ptr)) >> 3; 1879 g1 = (G_VAL(src_ptr)) >> 3;
1631 b1 = (B_VAL(src_ptr)) >> 3; 1880 b1 = (B_VAL(src_ptr)) >> 3;
1881
1882#ifndef BUILD_NO_DITHER_MASK
1632 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1883 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1633 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++; 1884 if (((R_VAL(src_ptr) - (r1 << 3)) >= dith) && (r1 < 0x1f)) r1++;
1634 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++; 1885 if (((G_VAL(src_ptr) - (g1 << 3)) >= dith) && (g1 < 0x1f)) g1++;
1635 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++; 1886 if (((B_VAL(src_ptr) - (b1 << 3)) >= dith) && (b1 < 0x1f)) b1++;
1887#endif
1636 1888
1637 CONVERT_LOOP2_INC_ROT_90(); 1889 CONVERT_LOOP2_INC_ROT_90();
1638 1890
1639 r2 = (R_VAL(src_ptr)) >> 3; 1891 r2 = (R_VAL(src_ptr)) >> 3;
1640 g2 = (G_VAL(src_ptr)) >> 3; 1892 g2 = (G_VAL(src_ptr)) >> 3;
1641 b2 = (B_VAL(src_ptr)) >> 3; 1893 b2 = (B_VAL(src_ptr)) >> 3;
1894
1895#ifndef BUILD_NO_DITHER_MASK
1642 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1896 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1643 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++; 1897 if (((R_VAL(src_ptr) - (r2 << 3)) >= dith) && (r2 < 0x1f)) r2++;
1644 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++; 1898 if (((G_VAL(src_ptr) - (g2 << 3)) >= dith) && (g2 < 0x1f)) g2++;
1645 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++; 1899 if (((B_VAL(src_ptr) - (b2 << 3)) >= dith) && (b2 < 0x1f)) b2++;
1900#endif
1646 1901
1647#ifndef WORDS_BIGENDIAN 1902#ifndef WORDS_BIGENDIAN
1648 *((DATA32 *)dst_ptr) = 1903 *((DATA32 *)dst_ptr) =
@@ -1670,7 +1925,9 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst,
1670 DATA16 *dst_ptr; 1925 DATA16 *dst_ptr;
1671 int x, y; 1926 int x, y;
1672 DATA8 r, g, b; 1927 DATA8 r, g, b;
1928#ifndef BUILD_NO_DITHER_MASK
1673 DATA8 dith; 1929 DATA8 dith;
1930#endif
1674 1931
1675 dst_ptr = (DATA16 *)dst; 1932 dst_ptr = (DATA16 *)dst;
1676 1933
@@ -1679,10 +1936,13 @@ evas_common_convert_rgba_to_16bpp_rgb_555_dith_rot_90 (DATA32 *src, DATA8 *dst,
1679 r = (R_VAL(src_ptr)) >> 3; 1936 r = (R_VAL(src_ptr)) >> 3;
1680 g = (G_VAL(src_ptr)) >> 3; 1937 g = (G_VAL(src_ptr)) >> 3;
1681 b = (B_VAL(src_ptr)) >> 3; 1938 b = (B_VAL(src_ptr)) >> 3;
1939
1940#ifndef BUILD_NO_DITHER_MASK
1682 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5); 1941 dith = DM_TABLE[(x + dith_x) & DM_MSK][(y + dith_y) & DM_MSK] >> DM_SHF(5);
1683 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++; 1942 if (((R_VAL(src_ptr) - (r << 3)) >= dith) && (r < 0x1f)) r++;
1684 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++; 1943 if (((G_VAL(src_ptr) - (g << 3)) >= dith) && (g < 0x1f)) g++;
1685 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++; 1944 if (((B_VAL(src_ptr) - (b << 3)) >= dith) && (b < 0x1f)) b++;
1945#endif
1686 1946
1687 *dst_ptr = (r << 10) | (g << 5) | (b); 1947 *dst_ptr = (r << 10) | (g << 5) | (b);
1688 1948