return mGLES->GetShadingLanguageVersion();
}
- const char* GetEglImageExtensionString()
- {
- return mGLES->GetEglImageExtensionString();
- }
-
void CacheConfigurations(ConfigurationManager& configurationManager) override;
private:
{
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
/**
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
#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
{
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[] = {
}
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),
GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
mEglGraphics = static_cast<EglGraphics*>(graphics);
- mCustomFragmentPrefix = mEglGraphics->GetEglImageExtensionString();
-
mTbmSurface = GetSurfaceFromAny(nativeImageSource);
if(mTbmSurface != NULL)
const char* NativeImageSourceTizen::GetCustomFragmentPrefix() const
{
- return mCustomFragmentPrefix;
+ return FRAGMENT_PREFIX;
}
const char* NativeImageSourceTizen::GetCustomSamplerTypename() const
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
{
#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[] = {
}
NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue)
-: mCustomFragmentPrefix(),
- mMutex(),
+: mMutex(),
mWidth(width),
mHeight(height),
mTbmQueue(NULL),
GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
mEglGraphics = static_cast<EglGraphics*>(graphics);
- mCustomFragmentPrefix = mEglGraphics->GetEglImageExtensionString();
-
mTbmQueue = GetSurfaceFromAny(nativeImageSourceQueue);
if(mTbmQueue != NULL)
const char* NativeImageSourceQueueTizen::GetCustomFragmentPrefix() const
{
- return mCustomFragmentPrefix;
+ return FRAGMENT_PREFIX;
}
const char* NativeImageSourceQueueTizen::GetCustomSamplerTypename() const
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