From: Seoyeon Kim Date: Tue, 13 Jul 2021 05:04:24 +0000 (+0900) Subject: [Tizen] Revert "Make to use right egl image extension name in the glsl 3.x" X-Git-Tag: accepted/tizen/unified/20210713.124152~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=5c0150919de142cf925654b3f8750aca558977cc [Tizen] Revert "Make to use right egl image extension name in the glsl 3.x" This reverts commit d2fed3ef69696425608efc37faba1751659aad4e. --- diff --git a/dali/internal/graphics/gles/egl-graphics.h b/dali/internal/graphics/gles/egl-graphics.h index 1caa4a6..f8141f4 100644 --- a/dali/internal/graphics/gles/egl-graphics.h +++ b/dali/internal/graphics/gles/egl-graphics.h @@ -194,11 +194,6 @@ public: return mGLES->GetShadingLanguageVersion(); } - const char* GetEglImageExtensionString() - { - return mGLES->GetEglImageExtensionString(); - } - void CacheConfigurations(ConfigurationManager& configurationManager) override; private: diff --git a/dali/internal/graphics/gles/gl-implementation.h b/dali/internal/graphics/gles/gl-implementation.h index 40d764d..4f3b8dc 100644 --- a/dali/internal/graphics/gles/gl-implementation.h +++ b/dali/internal/graphics/gles/gl-implementation.h @@ -40,23 +40,19 @@ namespace Adaptor { namespace { -static constexpr int32_t INITIAL_GLES_VERSION = 30; -static constexpr int32_t GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED = 32; -static constexpr const char* KHR_BLEND_EQUATION_ADVANCED = "GL_KHR_blend_equation_advanced"; +const int32_t INITIAL_GLES_VERSION = 30; +const int32_t GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED = 32; +const char* KHR_BLEND_EQUATION_ADVANCED = "GL_KHR_blend_equation_advanced"; -static constexpr const char* FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX = +const char* FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX = "#extension GL_KHR_blend_equation_advanced : enable\n" "#if GL_KHR_blend_equation_advanced==1 || __VERSION__>=320\n" " layout(blend_support_all_equations) out;\n" "#endif\n"; -static constexpr const char* FRAGMENT_SHADER_OUTPUT_COLOR_STRING = +const char* FRAGMENT_SHADER_OUTPUT_COLOR_STRING = "out mediump vec4 fragColor;\n"; - -static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING = "#extension GL_OES_EGL_image_external:require\n"; - -static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3 = "#extension GL_OES_EGL_image_external_essl3:require\n"; } // namespace /** @@ -357,23 +353,6 @@ public: return mShadingLanguageVersion; } - const char* GetEglImageExtensionString() - { - ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition); - if(!mIsContextCreated) - { - mContextCreatedWaitCondition.Wait(lock); - } - if(mShadingLanguageVersion < 300) - { - return OES_EGL_IMAGE_EXTERNAL_STRING; - } - else - { - return OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3; - } - } - /* OpenGL ES 2.0 */ void ActiveTexture(GLenum texture) override diff --git a/dali/internal/imaging/android/native-image-source-impl-android.cpp b/dali/internal/imaging/android/native-image-source-impl-android.cpp index 0754ecf..c3f8493 100644 --- a/dali/internal/imaging/android/native-image-source-impl-android.cpp +++ b/dali/internal/imaging/android/native-image-source-impl-android.cpp @@ -34,6 +34,12 @@ #include #include +namespace +{ +const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n"; +const char* SAMPLER_TYPE = "samplerExternalOES"; +} // namespace + namespace Dali { namespace Internal diff --git a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp index 16a5720..e98ddae 100644 --- a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp @@ -38,7 +38,8 @@ namespace Adaptor { namespace { -const char* SAMPLER_TYPE = "samplerExternalOES"; +const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n"; +const char* SAMPLER_TYPE = "samplerExternalOES"; // clang-format off tbm_format FORMATS_BLENDING_REQUIRED[] = { @@ -74,8 +75,7 @@ NativeImageSourceTizen* NativeImageSourceTizen::New(uint32_t width, uint32_t hei } NativeImageSourceTizen::NativeImageSourceTizen(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource) -: mCustomFragmentPrefix(), - mWidth(width), +: mWidth(width), mHeight(height), mOwnTbmSurface(false), mTbmSurface(NULL), @@ -94,8 +94,6 @@ NativeImageSourceTizen::NativeImageSourceTizen(uint32_t width, uint32_t height, GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface()); mEglGraphics = static_cast(graphics); - mCustomFragmentPrefix = mEglGraphics->GetEglImageExtensionString(); - mTbmSurface = GetSurfaceFromAny(nativeImageSource); if(mTbmSurface != NULL) @@ -464,7 +462,7 @@ void NativeImageSourceTizen::PrepareTexture() const char* NativeImageSourceTizen::GetCustomFragmentPrefix() const { - return mCustomFragmentPrefix; + return FRAGMENT_PREFIX; } const char* NativeImageSourceTizen::GetCustomSamplerTypename() const diff --git a/dali/internal/imaging/tizen/native-image-source-impl-tizen.h b/dali/internal/imaging/tizen/native-image-source-impl-tizen.h index 2fa10a8..7f48b92 100644 --- a/dali/internal/imaging/tizen/native-image-source-impl-tizen.h +++ b/dali/internal/imaging/tizen/native-image-source-impl-tizen.h @@ -190,10 +190,9 @@ private: void DestroySurface(); private: - const char* mCustomFragmentPrefix; ///< Prefix for CustomFragment - uint32_t mWidth; ///< image width - uint32_t mHeight; ///< image height - bool mOwnTbmSurface; ///< Whether we created pixmap or not + uint32_t mWidth; ///< image width + uint32_t mHeight; ///< image height + bool mOwnTbmSurface; ///< Whether we created pixmap or not tbm_surface_h mTbmSurface; tbm_format mTbmFormat; bool mBlendingRequired; ///< Whether blending is required diff --git a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp index 7f72939..8028efd 100644 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp @@ -38,7 +38,8 @@ namespace { #define TBM_SURFACE_QUEUE_SIZE 3 -const char* SAMPLER_TYPE = "samplerExternalOES"; +const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n"; +const char* SAMPLER_TYPE = "samplerExternalOES"; // clang-format off int FORMATS_BLENDING_REQUIRED[] = { @@ -72,8 +73,7 @@ NativeImageSourceQueueTizen* NativeImageSourceQueueTizen::New(uint32_t width, ui } NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue) -: mCustomFragmentPrefix(), - mMutex(), +: mMutex(), mWidth(width), mHeight(height), mTbmQueue(NULL), @@ -89,8 +89,6 @@ NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t width, uint32_ GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface()); mEglGraphics = static_cast(graphics); - mCustomFragmentPrefix = mEglGraphics->GetEglImageExtensionString(); - mTbmQueue = GetSurfaceFromAny(nativeImageSourceQueue); if(mTbmQueue != NULL) @@ -282,7 +280,7 @@ void NativeImageSourceQueueTizen::PrepareTexture() const char* NativeImageSourceQueueTizen::GetCustomFragmentPrefix() const { - return mCustomFragmentPrefix; + return FRAGMENT_PREFIX; } const char* NativeImageSourceQueueTizen::GetCustomSamplerTypename() const diff --git a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h index 5702eaf..4f86eb4 100644 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h @@ -171,17 +171,16 @@ private: private: typedef std::pair EglImagePair; - const char* mCustomFragmentPrefix; ///< Prefix for CustomFragment - Dali::Mutex mMutex; ///< Mutex - uint32_t mWidth; ///< image width - uint32_t mHeight; ///< image height - tbm_surface_queue_h mTbmQueue; ///< Tbm surface queue handle - tbm_surface_h mConsumeSurface; ///< The current tbm surface - std::vector mEglImages; ///< EGL Image vector - EglGraphics* mEglGraphics; ///< EGL Graphics - EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions - bool mOwnTbmQueue; ///< Whether we created tbm queue - bool mBlendingRequired; ///< Whether blending is required + Dali::Mutex mMutex; ///< Mutex + uint32_t mWidth; ///< image width + uint32_t mHeight; ///< image height + tbm_surface_queue_h mTbmQueue; ///< Tbm surface queue handle + tbm_surface_h mConsumeSurface; ///< The current tbm surface + std::vector mEglImages; ///< EGL Image vector + EglGraphics* mEglGraphics; ///< EGL Graphics + EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions + bool mOwnTbmQueue; ///< Whether we created tbm queue + bool mBlendingRequired; ///< Whether blending is required }; } // namespace Adaptor