summaryrefslogtreecommitdiff
path: root/src/modules/evas/image_savers
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-30 16:41:32 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-11-10 16:12:21 +0900
commit7974f674aa9ba18588576a373e1ec0c524bbde9f (patch)
treeb81a725c7ba05b529d4e1412545ff8d537a0bb9f /src/modules/evas/image_savers
parenta5d02848202475d87621fb61ce7a3e8dcecc11f5 (diff)
Evas: Allow edje_decc to work with ETC images
This reuses the internal function data_get, data_put, image_save respecting the border information and adding support for ETC formats. @fix
Diffstat (limited to 'src/modules/evas/image_savers')
-rw-r--r--src/modules/evas/image_savers/tgv/evas_image_save_tgv.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
index 2ce6ab0c56..44b38e0b39 100644
--- a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
+++ b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
@@ -53,12 +53,6 @@ _alpha_to_greyscale_convert(uint32_t *data, int len)
53static int 53static int
54_save_direct_tgv(RGBA_Image *im, const char *file, int compress) 54_save_direct_tgv(RGBA_Image *im, const char *file, int compress)
55{ 55{
56 // FIXME: Now we have border information, this comment isn't valid anymore:
57
58 // In case we are directly copying ETC1/2 data, we can't properly
59 // duplicate the 1 pixel borders. So we just assume the image contains
60 // them already.
61
62 // TODO: Add block by block compression. 56 // TODO: Add block by block compression.
63 57
64 int image_width, image_height, planes = 1; 58 int image_width, image_height, planes = 1;
@@ -69,8 +63,12 @@ _save_direct_tgv(RGBA_Image *im, const char *file, int compress)
69 uint8_t *data, *ptr; 63 uint8_t *data, *ptr;
70 FILE *f; 64 FILE *f;
71 65
72 image_width = im->cache_entry.w; 66 if (!im->cache_entry.borders.l || !im->cache_entry.borders.t ||
73 image_height = im->cache_entry.h; 67 !im->cache_entry.borders.r || !im->cache_entry.borders.b)
68 WRN("No im->cache_entry.borders on ETC image. Final image may have wrong dimensions.");
69
70 image_width = im->cache_entry.w + im->cache_entry.borders.l + im->cache_entry.borders.r;
71 image_height = im->cache_entry.h + im->cache_entry.borders.t + im->cache_entry.borders.b;
74 data = im->image.data8; 72 data = im->image.data8;
75 width = htonl(image_width); 73 width = htonl(image_width);
76 height = htonl(image_height); 74 height = htonl(image_height);