summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-12-08 13:50:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-12-08 18:02:44 +0900
commit52d117c90501c5cec32248b4231f8f44735bdcf9 (patch)
tree1666d8332ec1090e0ce99f273888156299e92e4c /src/lib/evas
parent378157ba1e2aac62cf8a61969157b81f0d535bd3 (diff)
Evas font: Compress font algo should round instead of floor
This is an attempt at having higher quality font rendering while still using RLE-based font compression.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_font_compress.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c
index 1b8d63114b..66c8511907 100644
--- a/src/lib/evas/common/evas_font_compress.c
+++ b/src/lib/evas/common/evas_font_compress.c
@@ -151,6 +151,9 @@ compress_rle4(DATA8 *src, int pitch, int w, int h, int *size_ret)
151 { 151 {
152 // we only need upper 4 bits of value for span creation 152 // we only need upper 4 bits of value for span creation
153 DATA8 v = pix[x] >> 4; 153 DATA8 v = pix[x] >> 4;
154 // round-up if closer to upper value
155 if ((pix[x] & 0x8) && (v != 0xF))
156 v++;
154 // if the current pixel value (in 4bit) is not the same as the 157 // if the current pixel value (in 4bit) is not the same as the
155 // span value (n 4 bit) OR... if the span now exceeds 16 pixels 158 // span value (n 4 bit) OR... if the span now exceeds 16 pixels
156 // then add/write out the span to our RLE span blob 159 // then add/write out the span to our RLE span blob
@@ -344,7 +347,11 @@ compress_bpp4(DATA8 *src, int pitch, int w, int h, int *size_ret)
344 // 4 bits only needed) and pack 347 // 4 bits only needed) and pack
345 for (x = 0; x < (w - 1); x += 2) 348 for (x = 0; x < (w - 1); x += 2)
346 { 349 {
347 *d = (s[0] & 0xf0) | (s[1] >> 4); 350 DATA8 v1 = s[0] >> 4;
351 DATA8 v2 = s[1] >> 4;
352 if ((s[0] & 0x08) && (v1 != 0x0f)) v1++;
353 if ((s[1] & 0x08) && (v2 != 0x0f)) v2++;
354 *d = (v1 << 4) | v2;
348 s += 2; 355 s += 2;
349 d++; 356 d++;
350 } 357 }