diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-15 12:11:33 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-15 12:11:33 +0900 |
commit | 2098e8c85695afe8aced1eb0619e908899f963e6 (patch) | |
tree | d96b90010aae7c7df42275465344f80a54d0d5c0 | |
parent | 0ece308bb15fa8fd1a002cdbcd9fe05bbc7b7902 (diff) | |
download | efl-2098e8c85695afe8aced1eb0619e908899f963e6.tar.gz |
evas gl - fix yuv smooth rendering
i found that we are not setting u and v to be smooth (linear
interpolate) for yuv reendering, even when asked. they remain at a
default "nearest". this enables linear for u and v always, meaning
even when smooth is off, we still interpolate u and v (not y), and
even when at 1:1 with no scaling u and v get interpolation for better
quality.
@fix!
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_context.c | 42 |
1 files changed, 40 insertions, 2 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 c330f372d5..413461a0ca 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -3114,8 +3114,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc) GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); - glActiveTexture(GL_TEXTURE0); - GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glActiveTexture(GL_TEXTURE0); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); } else { @@ -3151,6 +3151,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc) if (gc->pipe[i].shader.cur_texu_dyn) secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn); #endif + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glActiveTexture(GL_TEXTURE2); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); @@ -3160,6 +3168,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc) if (gc->pipe[i].shader.cur_texv_dyn) secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn); #endif + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glActiveTexture(GL_TEXTURE0); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); } @@ -3179,6 +3195,28 @@ shader_array_flush(Evas_Engine_GL_Context *gc) secsym_glEGLImageTargetTexture2DOES (GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn); #endif + if (gc->pipe[i].shader.smooth) + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + } + else + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + } glActiveTexture(GL_TEXTURE0); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); } |