summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-11-24 18:38:46 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-11-24 18:52:14 +0900
commit09934be78827674588678cdab2ce123e6fa5da5c (patch)
tree083f9d9f6f02f814b9fca778c52922ede3bc202f
parent0b06725e18079de9ad3020514771062bc3b19080 (diff)
Evas GL common: Fix RGB+A textures draw
Also rename texm into texa for consistency. Even though texa might be a mask image, it's still used only for it's a (alpha) channel.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index ff319d6a2c..d1bedec824 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -843,9 +843,9 @@ evas_gl_common_context_new(void)
843 SHADER_TEXTURE_ADD(shared, NV12_NOMUL, texuv); 843 SHADER_TEXTURE_ADD(shared, NV12_NOMUL, texuv);
844 844
845 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, tex); 845 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, tex);
846 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, texm); 846 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR, texa);
847 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, tex); 847 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, tex);
848 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, texm); 848 SHADER_TEXTURE_ADD(shared, RGB_A_PAIR_NOMUL, texa);
849 849
850 if (gc->state.current.cur_prog == PRG_INVALID) 850 if (gc->state.current.cur_prog == PRG_INVALID)
851 glUseProgram(shared->shader[0].prog); 851 glUseProgram(shared->shader[0].prog);
@@ -1403,7 +1403,7 @@ _evas_gl_common_context_push(int rtype,
1403#else 1403#else
1404 if (!((gc->pipe[pn].region.type == rtype) 1404 if (!((gc->pipe[pn].region.type == rtype)
1405 && (!tex || gc->pipe[pn].shader.cur_tex == current_tex) 1405 && (!tex || gc->pipe[pn].shader.cur_tex == current_tex)
1406 && (!texm || gc->pipe[pn].shader.cur_texm == current_texm) 1406 && (!texa || gc->pipe[pn].shader.cur_texa == current_texa)
1407 && (gc->pipe[pn].shader.cur_prog == prog) 1407 && (gc->pipe[pn].shader.cur_prog == prog)
1408 && (gc->pipe[pn].shader.smooth == smooth) 1408 && (gc->pipe[pn].shader.smooth == smooth)
1409 && (gc->pipe[pn].shader.blend == blend) 1409 && (gc->pipe[pn].shader.blend == blend)
@@ -1606,7 +1606,7 @@ again:
1606 gc->pipe[pn].array.use_texuv = 0; 1606 gc->pipe[pn].array.use_texuv = 0;
1607 gc->pipe[pn].array.use_texuv2 = 0; 1607 gc->pipe[pn].array.use_texuv2 = 0;
1608 gc->pipe[pn].array.use_texuv3 = 0; 1608 gc->pipe[pn].array.use_texuv3 = 0;
1609 gc->pipe[pn].array.use_texm = 0; 1609 gc->pipe[pn].array.use_texa = 0;
1610 gc->pipe[pn].array.use_texsam = 0; 1610 gc->pipe[pn].array.use_texsam = 0;
1611#endif 1611#endif
1612 1612
@@ -2981,7 +2981,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2981 unsigned char *texuv_ptr = NULL; 2981 unsigned char *texuv_ptr = NULL;
2982 unsigned char *texuv2_ptr = NULL; 2982 unsigned char *texuv2_ptr = NULL;
2983 unsigned char *texuv3_ptr = NULL; 2983 unsigned char *texuv3_ptr = NULL;
2984 unsigned char *texm_ptr = NULL; 2984 unsigned char *texa_ptr = NULL;
2985 unsigned char *texsam_ptr = NULL; 2985 unsigned char *texsam_ptr = NULL;
2986 2986
2987 if (glsym_glMapBuffer && glsym_glUnmapBuffer) 2987 if (glsym_glMapBuffer && glsym_glUnmapBuffer)
@@ -2996,8 +2996,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2996 texuv_ptr = color_ptr + COLOR_SIZE; 2996 texuv_ptr = color_ptr + COLOR_SIZE;
2997 texuv2_ptr = texuv_ptr + TEX_SIZE; 2997 texuv2_ptr = texuv_ptr + TEX_SIZE;
2998 texuv3_ptr = texuv2_ptr + TEX_SIZE; 2998 texuv3_ptr = texuv2_ptr + TEX_SIZE;
2999 texm_ptr = texuv3_ptr + TEX_SIZE; 2999 texa_ptr = texuv3_ptr + TEX_SIZE;
3000 texsam_ptr = texm_ptr + TEX_SIZE; 3000 texsam_ptr = texa_ptr + TEX_SIZE;
3001# define END_POINTER (texsam_ptr + TEX_SIZE) 3001# define END_POINTER (texsam_ptr + TEX_SIZE)
3002 3002
3003 glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer); 3003 glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer);
@@ -3024,7 +3024,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3024 if (gc->pipe[i].array.use_texuv3) 3024 if (gc->pipe[i].array.use_texuv3)
3025 memcpy(x + (unsigned long)texuv3_ptr, gc->pipe[i].array.texuv3, TEX_SIZE); 3025 memcpy(x + (unsigned long)texuv3_ptr, gc->pipe[i].array.texuv3, TEX_SIZE);
3026 if (gc->pipe[i].array.use_texa) 3026 if (gc->pipe[i].array.use_texa)
3027 memcpy(x + (unsigned long)texm_ptr, gc->pipe[i].array.texa, TEX_SIZE); 3027 memcpy(x + (unsigned long)texa_ptr, gc->pipe[i].array.texa, TEX_SIZE);
3028 if (gc->pipe[i].array.use_texsam) 3028 if (gc->pipe[i].array.use_texsam)
3029 memcpy(x + (unsigned long)texsam_ptr, gc->pipe[i].array.texsam, TEX_SIZE); 3029 memcpy(x + (unsigned long)texsam_ptr, gc->pipe[i].array.texsam, TEX_SIZE);
3030/* 3030/*
@@ -3038,7 +3038,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3038 gc->pipe[i].array.use_texuv, 3038 gc->pipe[i].array.use_texuv,
3039 gc->pipe[i].array.use_texuv2, 3039 gc->pipe[i].array.use_texuv2,
3040 gc->pipe[i].array.use_texuv3, 3040 gc->pipe[i].array.use_texuv3,
3041 gc->pipe[i].array.use_texm, 3041 gc->pipe[i].array.use_texa,
3042 gc->pipe[i].array.use_texsam); 3042 gc->pipe[i].array.use_texsam);
3043 */ 3043 */
3044 glsym_glUnmapBuffer(GL_ARRAY_BUFFER); 3044 glsym_glUnmapBuffer(GL_ARRAY_BUFFER);
@@ -3051,7 +3051,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3051 texuv_ptr = (unsigned char *)gc->pipe[i].array.texuv; 3051 texuv_ptr = (unsigned char *)gc->pipe[i].array.texuv;
3052 texuv2_ptr = (unsigned char *)gc->pipe[i].array.texuv2; 3052 texuv2_ptr = (unsigned char *)gc->pipe[i].array.texuv2;
3053 texuv3_ptr = (unsigned char *)gc->pipe[i].array.texuv3; 3053 texuv3_ptr = (unsigned char *)gc->pipe[i].array.texuv3;
3054 texm_ptr = (unsigned char *)gc->pipe[i].array.texa; 3054 texa_ptr = (unsigned char *)gc->pipe[i].array.texa;
3055 texsam_ptr = (unsigned char *)gc->pipe[i].array.texsam; 3055 texsam_ptr = (unsigned char *)gc->pipe[i].array.texsam;
3056 } 3056 }
3057 glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, (void *)vertex_ptr); 3057 glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, (void *)vertex_ptr);
@@ -3102,7 +3102,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3102 { 3102 {
3103 glEnableVertexAttribArray(SHAD_TEXA); 3103 glEnableVertexAttribArray(SHAD_TEXA);
3104 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3104 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3105 glVertexAttribPointer(SHAD_TEXA, 2, GL_FLOAT, GL_FALSE, 0, (void *)texm_ptr); 3105 glVertexAttribPointer(SHAD_TEXA, 2, GL_FLOAT, GL_FALSE, 0, (void *)texa_ptr);
3106 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3106 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3107 glActiveTexture(GL_TEXTURE1); 3107 glActiveTexture(GL_TEXTURE1);
3108 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3108 GLERR(__FUNCTION__, __FILE__, __LINE__, "");