raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2098e8c85695afe8aced1eb0619e908899f963e6

commit 2098e8c85695afe8aced1eb0619e908899f963e6
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Aug 15 12:11:33 2014 +0900

    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!
---
 .../evas/engines/gl_common/evas_gl_context.c       | 42 ++++++++++++++++++++--
 1 file 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 c330f37..413461a 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__, "");
                }

-- 


Reply via email to