[Tizen] Revert "Make to use right egl image extension name in the glsl 3.x"
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 3 Jun 2021 03:49:23 +0000 (12:49 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 8 Jun 2021 08:44:49 +0000 (17:44 +0900)
This reverts commit be84c04ec66073691ffbff8a33ccf7d3442b80b5.

Change-Id: Ic6ccb3b9b1a6385ea94cd4b00dde6a6c603f46e8

dali/internal/graphics/gles/egl-graphics.h
dali/internal/graphics/gles/gl-implementation.h
dali/internal/imaging/android/native-image-source-impl-android.cpp
dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-impl-tizen.h
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h

index 8c8d80c..5a5e78d 100644 (file)
@@ -187,11 +187,6 @@ public:
     return mGLES->GetShadingLanguageVersion();
   }
 
-  const char* GetEglImageExtensionString()
-  {
-    return mGLES->GetEglImageExtensionString();
-  }
-
   void CacheConfigurations(ConfigurationManager& configurationManager) override;
 
 private:
index 40d764d..4f3b8dc 100644 (file)
@@ -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
index 0754ecf..c3f8493 100644 (file)
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
 
+namespace
+{
+const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n";
+const char* SAMPLER_TYPE    = "samplerExternalOES";
+} // namespace
+
 namespace Dali
 {
 namespace Internal
index f0b7a0e..bbc14a7 100644 (file)
@@ -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<EglGraphics*>(graphics);
 
-  mCustomFragmentPrefix = mEglGraphics->GetEglImageExtensionString();
-
   mTbmSurface = GetSurfaceFromAny(nativeImageSource);
 
   if(mTbmSurface != NULL)
@@ -467,7 +465,7 @@ void NativeImageSourceTizen::PrepareTexture()
 
 const char* NativeImageSourceTizen::GetCustomFragmentPrefix() const
 {
-  return mCustomFragmentPrefix;
+  return FRAGMENT_PREFIX;
 }
 
 const char* NativeImageSourceTizen::GetCustomSamplerTypename() const
index 2fa10a8..7f48b92 100644 (file)
@@ -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
index 7f72939..8028efd 100644 (file)
@@ -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<EglGraphics*>(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
index 5702eaf..4f86eb4 100644 (file)
@@ -171,17 +171,16 @@ private:
 private:
   typedef std::pair<tbm_surface_h, void*> 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<EglImagePair> 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<EglImagePair> 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