summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-06-23 09:31:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-06-23 11:20:13 +0900
commit37431fb1a18bfa0c940a1f93b67c2e5d9cbb920a (patch)
tree678329f2ebb7cf8d8f85e87881d53826a675778c /src/static_libs
parent5f52f5c9e5758f52f2bc9e4b7220c8c61076f4ea (diff)
Evas ETC2: Remove some useless operations
No need to write out alpha in a RGBA color when only the RGB values are used by the distance op. Also, add a comment on the byte order. Maybe I'm wrong but I believe the operations are fine wrt. byte order :)
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/rg_etc/etc2_encoder.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/static_libs/rg_etc/etc2_encoder.c b/src/static_libs/rg_etc/etc2_encoder.c
index 54481e8..8f7fe3c 100644
--- a/src/static_libs/rg_etc/etc2_encoder.c
+++ b/src/static_libs/rg_etc/etc2_encoder.c
@@ -129,6 +129,14 @@ absi(int a)
129#define G_VAL(v) ((uint8_t) ((v & 0x0000FF00) >> 8)) 129#define G_VAL(v) ((uint8_t) ((v & 0x0000FF00) >> 8))
130#define B_VAL(v) ((uint8_t) ((v & 0x000000FF))) 130#define B_VAL(v) ((uint8_t) ((v & 0x000000FF)))
131 131
132#ifndef WORDS_BIGENDIAN
133# define RGB_START 0
134# define RGB_END 2
135#else
136# define RGB_START 1
137# define RGB_END 3
138#endif
139
132#ifndef DBG 140#ifndef DBG
133# ifdef DEBUG 141# ifdef DEBUG
134# define DBG(fmt, ...) fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## __VA_ARGS__) 142# define DBG(fmt, ...) fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## __VA_ARGS__)
@@ -463,6 +471,10 @@ _etc2_th_mode_block_pack(uint8_t *etc2, Eina_Bool h_mode,
463 } paint_colors[4], color1, color2; 471 } paint_colors[4], color1, color2;
464 int errAcc = 0; 472 int errAcc = 0;
465 473
474 paint_colors[0].v = 0;
475 paint_colors[1].v = 0;
476 paint_colors[2].v = 0;
477 paint_colors[3].v = 0;
466 color1.v = c1; 478 color1.v = c1;
467 color2.v = c2; 479 color2.v = c2;
468 480
@@ -488,7 +500,8 @@ _etc2_th_mode_block_pack(uint8_t *etc2, Eina_Bool h_mode,
488 } 500 }
489 } 501 }
490 502
491 for (int k = 0; k < 4; k++) 503 // Set paint_colors using R,G,B values (byte order is preserved)
504 for (int k = RGB_START; k <= RGB_END; k++)
492 { 505 {
493 if (!h_mode) 506 if (!h_mode)
494 { 507 {