Revert "[3.0] Modify texture bind for OES_EGL_image_external" 76/97576/1
authordongsug.song <dongsug.song@samsung.com>
Mon, 14 Nov 2016 13:44:42 +0000 (22:44 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 14 Nov 2016 13:45:02 +0000 (22:45 +0900)
This reverts commit e3f1a3ca11234576099f419dc245d66721a94cc9.

Change-Id: I6376508af51c59f2005e168a5e6de7264d7a9c4f

automated-tests/src/dali/dali-test-suite-utils/test-native-image.h
dali/devel-api/images/native-image-interface-extension.h
dali/internal/render/gl-resources/context.h
dali/internal/render/gl-resources/native-texture.cpp

index 3a6557f..7724717 100644 (file)
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/images/native-image-interface.h>
 #include <dali/devel-api/images/native-image-interface-extension.h>
-#include <dali/integration-api/gl-defines.h>
 
 namespace Dali
 {
@@ -36,8 +35,6 @@ public:
   inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
   inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
 
-  inline int GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
-
 };
 
 class DALI_IMPORT_API TestNativeImage : public Dali::NativeImageInterface
index dfc60d4..ca19c14 100644 (file)
@@ -48,13 +48,6 @@ public:
   virtual const char* GetCustomSamplerTypename() = 0;
 
   /**
-   * @brief Get texture target for binding native image as texture.
-   *
-   * @return Texture target.
-   */
-  virtual int GetEglImageTextureTarget() = 0;
-
-  /**
    * @brief Retrieve the extension for the interface.
    *
    * @return Extension2 pointer if available, NULL otherwise
index 136f09b..c2f11ac 100644 (file)
@@ -286,20 +286,6 @@ public:
   }
 
   /**
-   * Wrapper for OpenGL ES 2.0 glBindTexture( target )
-   */
-  void BindTexture( int target, GLuint texture )
-  {
-    if (mBound2dTextureId[ mActiveTextureUnit ] != texture)
-    {
-      mBound2dTextureId[ mActiveTextureUnit ] = texture;
-
-      LOG_GL("BindTexture target(%d) %d\n", target, texture);
-      CHECK_GL( mGlAbstraction, mGlAbstraction.BindTexture(target, texture) );
-    }
-  }
-
-  /**
    * Wrapper for OpenGL ES 2.0 glBindTexture(GL_TEXTURE_CUBE_MAP)
    */
   void BindCubeMapTexture( GLuint texture )
index 11a62ce..8110880 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/gl-resources/texture-units.h>
 #include <dali/internal/render/gl-resources/gl-texture.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
 
 namespace Dali
 {
@@ -63,15 +62,8 @@ bool NativeTexture::Bind( GLenum target, TextureUnit textureunit )
   {
     // Bind the texture id
     mContext.ActiveTexture( textureunit );
+    mContext.Bind2dTexture(mId);
 
-    int textureTarget = GL_TEXTURE_2D;
-    NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-    if( extension )
-    {
-      textureTarget = extension->GetEglImageTextureTarget();
-    }
-
-    mContext.BindTexture( textureTarget, mId );
     mNativeImage->PrepareTexture();
   }
 
@@ -100,15 +92,7 @@ bool NativeTexture::CreateGlTexture()
   {
     mContext.GenTextures( 1, &mId );
     mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD );  // bind in unused unit so rebind works the first time
-
-    int textureTarget = GL_TEXTURE_2D;
-    NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-    if( extension )
-    {
-      textureTarget = extension->GetEglImageTextureTarget();
-    }
-
-    mContext.BindTexture( textureTarget, mId );
+    mContext.Bind2dTexture( mId );
 
     mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data