Add ApplyCustomFragmentPrefix 09/260409/14
authorseungho <sbsh.baek@samsung.com>
Thu, 24 Jun 2021 07:13:34 +0000 (16:13 +0900)
committerseungho <sbsh.baek@samsung.com>
Wed, 21 Jul 2021 02:54:18 +0000 (11:54 +0900)
 - Apply suitable prefix for the native image fragment shader

Change-Id: I8315c904b08a7d1443458d877f202dfa62714fed
Signed-off-by: seungho <sbsh.baek@samsung.com>
27 files changed:
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-native-image.h
dali/devel-api/adaptor-framework/native-image-source-queue.cpp
dali/devel-api/adaptor-framework/native-image-source-queue.h
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/android/native-image-source-impl-android.h
dali/internal/imaging/android/native-image-source-queue-impl-android.cpp
dali/internal/imaging/android/native-image-source-queue-impl-android.h
dali/internal/imaging/common/native-bitmap-buffer-impl.cpp
dali/internal/imaging/common/native-bitmap-buffer-impl.h
dali/internal/imaging/common/native-image-source-impl.h
dali/internal/imaging/common/native-image-source-queue-impl.h
dali/internal/imaging/macos/native-image-source-impl-mac.cpp
dali/internal/imaging/macos/native-image-source-impl-mac.h
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
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h
dali/internal/imaging/windows/native-image-source-impl-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.h
dali/public-api/adaptor-framework/native-image-source.cpp
dali/public-api/adaptor-framework/native-image-source.h

index d134942..fb9451c 100644 (file)
@@ -83,6 +83,23 @@ public:
     mCallStack.PushCall("GetCustomFragmentPrefix", "");
     return "#extension GL_OES_EGL_image_external:require\n";
   };
+  inline virtual bool ApplyNativeFragmentShader(std::string& shader)
+  {
+    mCallStack.PushCall("ApplyNativeFragmentShader", "");
+    shader = "#extension GL_OES_EGL_image_external:require\n" + shader;
+
+    //Get custom sampler type name
+    const char* customSamplerTypename = GetCustomSamplerTypename();
+    if(customSamplerTypename)
+    {
+      size_t samplerPosition = shader.find("sampler2D");
+      if(samplerPosition != std::string::npos)
+      {
+        shader.replace(samplerPosition, strlen("sampler2D"), customSamplerTypename);
+      }
+    }
+    return true;
+  };
   inline const char* GetCustomSamplerTypename() const override
   {
     mCallStack.PushCall("GetCustomSamplerTypename", "");
index a144139..f7d202e 100644 (file)
@@ -105,6 +105,11 @@ const char* NativeImageSourceQueue::GetCustomFragmentPrefix() const
   return mImpl->GetCustomFragmentPrefix();
 }
 
+bool NativeImageSourceQueue::ApplyNativeFragmentShader(std::string& shader)
+{
+  return mImpl->ApplyNativeFragmentShader(shader);
+}
+
 const char* NativeImageSourceQueue::GetCustomSamplerTypename() const
 {
   return mImpl->GetCustomSamplerTypename();
index 788c565..1c90b81 100644 (file)
@@ -121,6 +121,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 1caa4a6..399ff1a 100644 (file)
@@ -194,9 +194,9 @@ public:
     return mGLES->GetShadingLanguageVersion();
   }
 
-  const char* GetEglImageExtensionString()
+  bool ApplyNativeFragmentShader(std::string& shader, const char* customSamplerType)
   {
-    return mGLES->GetEglImageExtensionString();
+    return mGLES->ApplyNativeFragmentShader(shader, customSamplerType);
   }
 
   void CacheConfigurations(ConfigurationManager& configurationManager) override;
index 40d764d..e60fb8f 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/internal/graphics/common/egl-include.h>
 #include <cstdlib>
+#include <cstring>
 #include <memory>
 
 // INTERNAL INCLUDES
@@ -42,8 +43,11 @@ namespace
 {
 static constexpr int32_t     INITIAL_GLES_VERSION                         = 30;
 static constexpr int32_t     GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED = 32;
+static constexpr const char* LEGACY_SHADING_LANGUAGE_VERSION              = "100";
 static constexpr const char* KHR_BLEND_EQUATION_ADVANCED                  = "GL_KHR_blend_equation_advanced";
 
+static constexpr const char* DEFAULT_SAMPLER_TYPE = "sampler2D";
+
 static constexpr const char* FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX =
   "#extension GL_KHR_blend_equation_advanced : enable\n"
 
@@ -357,21 +361,52 @@ public:
     return mShadingLanguageVersion;
   }
 
-  const char* GetEglImageExtensionString()
+  bool ApplyNativeFragmentShader(std::string& shader, const char* customSamplerType)
   {
-    ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
-    if(!mIsContextCreated)
+    bool        modified        = false;
+    std::string versionString   = "#version";
+    size_t      versionPosition = shader.find(versionString);
+    if(versionPosition != std::string::npos)
     {
-      mContextCreatedWaitCondition.Wait(lock);
+      std::string extensionString;
+      size_t shadingLanguageVersionPosition = shader.find_first_not_of(" \t", versionPosition + versionString.length());
+      if(shadingLanguageVersionPosition != std::string::npos &&
+         shader.substr(shadingLanguageVersionPosition, 3) == LEGACY_SHADING_LANGUAGE_VERSION)
+      {
+        extensionString = OES_EGL_IMAGE_EXTERNAL_STRING;
+      }
+      else
+      {
+        extensionString = OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3;
+      }
+
+      if(shader.find(extensionString) == std::string::npos)
+      {
+        modified                 = true;
+        size_t extensionPosition = shader.find_first_of("\n", versionPosition) + 1;
+        shader.insert(extensionPosition, extensionString);
+      }
     }
-    if(mShadingLanguageVersion < 300)
+    else
     {
-      return OES_EGL_IMAGE_EXTERNAL_STRING;
+      if(shader.find(OES_EGL_IMAGE_EXTERNAL_STRING) == std::string::npos)
+      {
+        modified = true;
+        shader   = OES_EGL_IMAGE_EXTERNAL_STRING + shader;
+      }
     }
-    else
+
+    if(shader.find(customSamplerType) == std::string::npos)
     {
-      return OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3;
+      size_t pos = shader.find(DEFAULT_SAMPLER_TYPE);
+      if(pos != std::string::npos)
+      {
+        modified = true;
+        shader.replace(pos, strlen(DEFAULT_SAMPLER_TYPE), customSamplerType);
+      }
     }
+
+    return modified;
   }
 
   /* OpenGL ES 2.0 */
index 0754ecf..9584864 100644 (file)
@@ -308,6 +308,11 @@ const char* NativeImageSourceAndroid::GetCustomFragmentPrefix() const
   return nullptr;
 }
 
+bool NativeImageSourceAndroid::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
+}
+
 const char* NativeImageSourceAndroid::GetCustomSamplerTypename() const
 {
   return nullptr;
index 04e44bc..6cb21b8 100644 (file)
@@ -135,6 +135,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageSource::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 5df59b4..436fdd3 100644 (file)
@@ -33,12 +33,6 @@ namespace Internal
 {
 namespace Adaptor
 {
-namespace
-{
-const char* FRAGMENT_PREFIX = "\n";
-const char* SAMPLER_TYPE    = "sampler2D";
-
-} // namespace
 
 NativeImageSourceQueueAndroid* NativeImageSourceQueueAndroid::New(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue)
 {
@@ -92,12 +86,17 @@ void NativeImageSourceQueueAndroid::PrepareTexture()
 
 const char* NativeImageSourceQueueAndroid::GetCustomFragmentPrefix() const
 {
-  return FRAGMENT_PREFIX;
+  return nullptr;
+}
+
+bool NativeImageSourceQueueAndroid::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
 }
 
 const char* NativeImageSourceQueueAndroid::GetCustomSamplerTypename() const
 {
-  return SAMPLER_TYPE;
+  return nullptr;
 }
 
 int NativeImageSourceQueueAndroid::GetTextureTarget() const
index 92766b9..7e96038 100644 (file)
@@ -127,6 +127,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 24a15ff..e754cdb 100644 (file)
@@ -115,6 +115,11 @@ const char* NativeBitmapBuffer::GetCustomFragmentPrefix() const
   return nullptr;
 }
 
+bool NativeBitmapBuffer::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
+}
+
 const char* NativeBitmapBuffer::GetCustomSamplerTypename() const
 {
   return nullptr;
index 5527fd4..2166c17 100644 (file)
@@ -113,6 +113,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index f2d3295..077b9e0 100644 (file)
@@ -120,6 +120,11 @@ public:
   virtual const char* GetCustomFragmentPrefix() const = 0;
 
   /**
+   * @copydoc Dali::NativeImageSource::ApplyNativeFragmentShader()
+   */
+  virtual bool ApplyNativeFragmentShader(std::string& shader) = 0;
+
+  /**
    * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
    */
   virtual const char* GetCustomSamplerTypename() const = 0;
index 00ccbfc..612d49d 100644 (file)
@@ -104,6 +104,11 @@ public:
   virtual const char* GetCustomFragmentPrefix() const = 0;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  virtual bool ApplyNativeFragmentShader(std::string& shader) = 0;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   virtual const char* GetCustomSamplerTypename() const = 0;
index 5b80733..c0abb5d 100644 (file)
@@ -159,6 +159,11 @@ const char* NativeImageSourceCocoa::GetCustomFragmentPrefix() const
   return nullptr;
 }
 
+bool NativeImageSourceCocoa::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
+}
+
 const char* NativeImageSourceCocoa::GetCustomSamplerTypename() const
 {
   return nullptr;
index bd0e41b..a70f33c 100644 (file)
@@ -119,6 +119,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 16a5720..b3afaaa 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)
@@ -464,7 +462,12 @@ void NativeImageSourceTizen::PrepareTexture()
 
 const char* NativeImageSourceTizen::GetCustomFragmentPrefix() const
 {
-  return mCustomFragmentPrefix;
+  return FRAGMENT_PREFIX;
+}
+
+bool NativeImageSourceTizen::ApplyNativeFragmentShader(std::string& shader)
+{
+  return mEglGraphics->ApplyNativeFragmentShader(shader, SAMPLER_TYPE);
 }
 
 const char* NativeImageSourceTizen::GetCustomSamplerTypename() const
index 2fa10a8..7436a33 100644 (file)
@@ -131,6 +131,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader(std::string& shader)
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
@@ -190,10 +195,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..e16fbc2 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,12 @@ void NativeImageSourceQueueTizen::PrepareTexture()
 
 const char* NativeImageSourceQueueTizen::GetCustomFragmentPrefix() const
 {
-  return mCustomFragmentPrefix;
+  return FRAGMENT_PREFIX;
+}
+
+bool NativeImageSourceQueueTizen::ApplyNativeFragmentShader(std::string& shader)
+{
+  return mEglGraphics->ApplyNativeFragmentShader(shader, SAMPLER_TYPE);
 }
 
 const char* NativeImageSourceQueueTizen::GetCustomSamplerTypename() const
index 5702eaf..ae2bf8d 100644 (file)
@@ -123,6 +123,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
@@ -171,17 +176,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
index bb41acd..45afbed 100644 (file)
@@ -362,6 +362,11 @@ const char* NativeImageSourceX::GetCustomFragmentPrefix() const
   return nullptr;
 }
 
+bool NativeImageSourceX::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
+}
+
 const char* NativeImageSourceX::GetCustomSamplerTypename() const
 {
   return nullptr;
index 3c3dc1e..ba132b9 100644 (file)
@@ -135,6 +135,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageSource::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 257e0f6..e7d77fb 100644 (file)
@@ -36,10 +36,6 @@ namespace Adaptor
 namespace
 {
 #define TBM_SURFACE_QUEUE_SIZE 3
-
-const char* FRAGMENT_PREFIX = "\n";
-const char* SAMPLER_TYPE    = "sampler2D";
-
 } // namespace
 
 NativeImageSourceQueueX* NativeImageSourceQueueX::New(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue)
@@ -94,12 +90,17 @@ void NativeImageSourceQueueX::PrepareTexture()
 
 const char* NativeImageSourceQueueX::GetCustomFragmentPrefix() const
 {
-  return FRAGMENT_PREFIX;
+  return nullptr;
+}
+
+bool NativeImageSourceQueueX::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
 }
 
 const char* NativeImageSourceQueueX::GetCustomSamplerTypename() const
 {
-  return SAMPLER_TYPE;
+  return nullptr;
 }
 
 int NativeImageSourceQueueX::GetTextureTarget() const
index 50a1452..b119cb0 100644 (file)
@@ -124,6 +124,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index 02c5fdf..ce0189b 100644 (file)
@@ -233,6 +233,11 @@ const char* NativeImageSourceWin::GetCustomFragmentPrefix() const
   return nullptr;
 }
 
+bool NativeImageSourceWin::ApplyNativeFragmentShader(std::string& shader)
+{
+  return false;
+}
+
 const char* NativeImageSourceWin::GetCustomSamplerTypename() const
 {
   return nullptr;
index e17503e..e47f306 100644 (file)
@@ -125,6 +125,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;
index d5de092..2f528e0 100644 (file)
@@ -110,6 +110,11 @@ const char* NativeImageSource::GetCustomFragmentPrefix() const
   return mImpl->GetCustomFragmentPrefix();
 }
 
+bool NativeImageSource::ApplyNativeFragmentShader(std::string& shader)
+{
+  return mImpl->ApplyNativeFragmentShader(shader);
+}
+
 const char* NativeImageSource::GetCustomSamplerTypename() const
 {
   return mImpl->GetCustomSamplerTypename();
index 9c0f89f..2e0e8d1 100644 (file)
@@ -162,6 +162,11 @@ public:
   const char* GetCustomFragmentPrefix() const override;
 
   /**
+   * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
+   */
+  bool ApplyNativeFragmentShader(std::string& shader) override;
+
+  /**
    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
    */
   const char* GetCustomSamplerTypename() const override;