From 5eb494ee252b66b4a84e1a31b8869bd695d8c40e Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Mon, 14 Nov 2016 22:44:42 +0900 Subject: [PATCH] Revert "[3.0] Modify texture bind for OES_EGL_image_external" This reverts commit e3f1a3ca11234576099f419dc245d66721a94cc9. Change-Id: I6376508af51c59f2005e168a5e6de7264d7a9c4f --- .../dali/dali-test-suite-utils/test-native-image.h | 3 --- .../images/native-image-interface-extension.h | 7 ------- dali/internal/render/gl-resources/context.h | 14 -------------- dali/internal/render/gl-resources/native-texture.cpp | 20 ++------------------ 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h index 3a6557f..7724717 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h @@ -21,7 +21,6 @@ // INTERNAL INCLUDES #include #include -#include 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 diff --git a/dali/devel-api/images/native-image-interface-extension.h b/dali/devel-api/images/native-image-interface-extension.h index dfc60d4..ca19c14 100644 --- a/dali/devel-api/images/native-image-interface-extension.h +++ b/dali/devel-api/images/native-image-interface-extension.h @@ -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 diff --git a/dali/internal/render/gl-resources/context.h b/dali/internal/render/gl-resources/context.h index 136f09b..c2f11ac 100644 --- a/dali/internal/render/gl-resources/context.h +++ b/dali/internal/render/gl-resources/context.h @@ -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 ) diff --git a/dali/internal/render/gl-resources/native-texture.cpp b/dali/internal/render/gl-resources/native-texture.cpp index 11a62ce..8110880 100644 --- a/dali/internal/render/gl-resources/native-texture.cpp +++ b/dali/internal/render/gl-resources/native-texture.cpp @@ -23,7 +23,6 @@ #include #include #include -#include 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 -- 2.7.4