summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_texture.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-07-09 13:58:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-07-09 14:01:11 +0900
commitc65918eaedbc48bbb9dddf5c21a85f21ff2171f4 (patch)
tree7cc382dde14dbf65ec6d6e93eac60c293e02f004 /src/modules/evas/engines/gl_common/evas_gl_texture.c
parentec9ffd0ae85988679c4f029c8783259b0544abf0 (diff)
Evas gl: Add errors when using ETC1+Alpha as a normal texture
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 791dafbd40..d7bdcac1ed 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -510,7 +510,6 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
510 case EVAS_COLORSPACE_ETC1: 510 case EVAS_COLORSPACE_ETC1:
511 case EVAS_COLORSPACE_RGB8_ETC2: 511 case EVAS_COLORSPACE_RGB8_ETC2:
512 case EVAS_COLORSPACE_RGBA8_ETC2_EAC: 512 case EVAS_COLORSPACE_RGBA8_ETC2_EAC:
513 case EVAS_COLORSPACE_ETC1_ALPHA:
514 case EVAS_COLORSPACE_RGB_S3TC_DXT1: 513 case EVAS_COLORSPACE_RGB_S3TC_DXT1:
515 case EVAS_COLORSPACE_RGBA_S3TC_DXT1: 514 case EVAS_COLORSPACE_RGBA_S3TC_DXT1:
516 case EVAS_COLORSPACE_RGBA_S3TC_DXT2: 515 case EVAS_COLORSPACE_RGBA_S3TC_DXT2:
@@ -524,7 +523,10 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
524 xoffset = im->cache_entry.borders.l; 523 xoffset = im->cache_entry.borders.l;
525 yoffset = im->cache_entry.borders.t; 524 yoffset = im->cache_entry.borders.t;
526 break; 525 break;
527 526 case EVAS_COLORSPACE_ETC1_ALPHA:
527 // One must call evas_gl_common_texture_rgb_a_pair_new() instead.
528 ERR("Trying to upload ETC1+Alpha texture as a normal texture. Abort.");
529 return NULL;
528 default: 530 default:
529 // One pixel gap and two pixels for duplicated borders 531 // One pixel gap and two pixels for duplicated borders
530 w = im->cache_entry.w + 3; 532 w = im->cache_entry.w + 3;
@@ -1182,7 +1184,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1182 case EVAS_COLORSPACE_RGB_S3TC_DXT1: 1184 case EVAS_COLORSPACE_RGB_S3TC_DXT1:
1183 case EVAS_COLORSPACE_RGBA_S3TC_DXT1: 1185 case EVAS_COLORSPACE_RGBA_S3TC_DXT1:
1184 case EVAS_COLORSPACE_ETC1: 1186 case EVAS_COLORSPACE_ETC1:
1185 case EVAS_COLORSPACE_ETC1_ALPHA:
1186 case EVAS_COLORSPACE_RGB8_ETC2: 1187 case EVAS_COLORSPACE_RGB8_ETC2:
1187 { 1188 {
1188 /* 1189 /*
@@ -1205,8 +1206,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1205 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 1206 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1206 1207
1207 if ((tex->gc->shared->info.etc1_subimage || 1208 if ((tex->gc->shared->info.etc1_subimage ||
1208 ((im->cache_entry.space != EVAS_COLORSPACE_ETC1) && 1209 (im->cache_entry.space != EVAS_COLORSPACE_ETC1))
1209 (im->cache_entry.space != EVAS_COLORSPACE_ETC1_ALPHA)))
1210 && (tex->pt->w != width || tex->pt->h != height)) 1210 && (tex->pt->w != width || tex->pt->h != height))
1211 { 1211 {
1212 int err; 1212 int err;
@@ -1226,8 +1226,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1226 // FIXME: Changing settings on the fly. 1226 // FIXME: Changing settings on the fly.
1227 // The first texture will be black. 1227 // The first texture will be black.
1228 // How to fallback? We need a whole texture now. 1228 // How to fallback? We need a whole texture now.
1229 if ((im->cache_entry.space == EVAS_COLORSPACE_ETC1) || 1229 if (im->cache_entry.space == EVAS_COLORSPACE_ETC1)
1230 (im->cache_entry.space == EVAS_COLORSPACE_ETC1_ALPHA))
1231 tex->gc->shared->info.etc1_subimage = EINA_FALSE; 1230 tex->gc->shared->info.etc1_subimage = EINA_FALSE;
1232 } 1231 }
1233 } 1232 }
@@ -1245,12 +1244,15 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1245 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1244 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1246 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 1245 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1247 } 1246 }
1248
1249 return; 1247 return;
1250 } 1248 }
1249 case EVAS_COLORSPACE_ETC1_ALPHA:
1250 // One must call evas_gl_common_texture_rgb_a_pair_update() instead.
1251 ERR("Can't upload ETC1+Alpha texture as a normal texture. Abort.");
1252 return;
1251 default: 1253 default:
1252 ERR("Don't know how to upload texture in colorspace %i.", im->cache_entry.space); 1254 ERR("Can't upload texture in colorspace %i.", im->cache_entry.space);
1253 return; 1255 return;
1254 } 1256 }
1255 1257
1256 // if preloaded, then async push it in after uploading a miniature of it 1258 // if preloaded, then async push it in after uploading a miniature of it