TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
{
- mExtension = new TestNativeImageExtension();
}
TestNativeImage::~TestNativeImage()
{
}
-
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
-{
- return new TestNativeImageNoExt(width, height);
-}
-
-TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
-{
-}
-
-TestNativeImageNoExt::~TestNativeImageNoExt()
-{
-}
-
} // namespace dali
// INTERNAL INCLUDES
#include <dali/public-api/images/native-image-interface.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali/integration-api/gl-defines.h>
namespace Dali
{
class TestNativeImage;
-class TestNativeImageNoExt;
typedef IntrusivePtr<TestNativeImage> TestNativeImagePointer;
-typedef IntrusivePtr<TestNativeImageNoExt> TestNativeImageNoExtPointer;
-
-class DALI_CORE_API TestNativeImageExtension: public Dali::NativeImageInterface::Extension
-{
-public:
- inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
- inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
-
- inline int32_t GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
-
-};
class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
{
static TestNativeImagePointer New(uint32_t width, uint32_t height);
inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
- inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
- inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
- inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
+ inline virtual bool CreateResource() { ++mExtensionCreateCalls; return createResult;};
+ inline virtual void DestroyResource() { ++mExtensionDestroyCalls; };
+ inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return mTargetTextureError;};
inline virtual void PrepareTexture() {};
inline virtual uint32_t GetWidth() const {return mWidth;};
inline virtual uint32_t GetHeight() const {return mHeight;};
inline virtual bool RequiresBlending() const {return true;};
- inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
+ inline virtual int GetTextureTarget() const {return GL_TEXTURE_EXTERNAL_OES;};
+ inline virtual const char* GetCustomFragmentPrefix() const {return "#extension GL_OES_EGL_image_external:require\n";};
+ inline const char* GetCustomSamplerTypename() const override { return "samplerExternalOES"; };
+
+ inline Any GetNativeImageHandle() const override { return nullptr; };
+ inline bool SourceChanged() const override { return false; };
+
+ inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return nullptr;}
private:
TestNativeImage(uint32_t width, uint32_t height);
int32_t mExtensionCreateCalls;
int32_t mExtensionDestroyCalls;
int32_t mTargetTextureCalls;
-
+ uint32_t mTargetTextureError=0u;
bool createResult;
- TestNativeImageExtension* mExtension;
};
-class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
-{
-public:
- static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
-
- inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
- inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
- inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
- inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
- inline virtual void PrepareTexture() {};
- inline virtual uint32_t GetWidth() const {return mWidth;};
- inline virtual uint32_t GetHeight() const {return mHeight;};
- inline virtual bool RequiresBlending() const {return true;};
-
-private:
- TestNativeImageNoExt(uint32_t width, uint32_t height);
- virtual ~TestNativeImageNoExt();
-
- uint32_t mWidth;
- uint32_t mHeight;
-public:
- int32_t mExtensionCreateCalls;
- int32_t mExtensionDestroyCalls;
- int32_t mTargetTextureCalls;
- bool createResult;
-};
} // Dali
mImpl->IgnoreSourceImage();
}
-bool NativeImageSourceQueue::GlExtensionCreate()
+bool NativeImageSourceQueue::CreateResource()
{
- return mImpl->GlExtensionCreate();
+ return mImpl->CreateResource();
}
-void NativeImageSourceQueue::GlExtensionDestroy()
+void NativeImageSourceQueue::DestroyResource()
{
- mImpl->GlExtensionDestroy();
+ mImpl->DestroyResource();
}
uint32_t NativeImageSourceQueue::TargetTexture()
return mImpl->RequiresBlending();
}
+int NativeImageSourceQueue::GetTextureTarget() const
+{
+ return mImpl->GetTextureTarget();
+}
+
+const char* NativeImageSourceQueue::GetCustomFragmentPrefix() const
+{
+ return mImpl->GetCustomFragmentPrefix();
+}
+
+const char* NativeImageSourceQueue::GetCustomSamplerTypename() const
+{
+ return mImpl->GetCustomSamplerTypename();
+}
+
+Any NativeImageSourceQueue::GetNativeImageHandle() const
+{
+ return mImpl->GetNativeImageHandle();
+}
+
+bool NativeImageSourceQueue::SourceChanged() const
+{
+ return mImpl->SourceChanged();
+}
+
NativeImageInterface::Extension* NativeImageSourceQueue::GetExtension()
{
return mImpl->GetNativeImageInterfaceExtension();
*/
void IgnoreSourceImage();
+ /**
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
+ */
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
+
private: // native image
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- virtual bool GlExtensionCreate();
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- virtual void GlExtensionDestroy();
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual uint32_t TargetTexture();
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
*/
- virtual void PrepareTexture();
+ void PrepareTexture() override;
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual uint32_t GetWidth() const;
+ uint32_t GetWidth() const override;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual uint32_t GetHeight() const;
+ uint32_t GetHeight() const override;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
*/
- virtual bool RequiresBlending() const;
+ bool RequiresBlending() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
#include <dali/internal/graphics/gles/egl-graphics.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
+
+namespace
+{
+const char* FRAGMENT_PREFIX = "#extension GL_OES_EGL_image_external:require\n";
+const char* SAMPLER_TYPE = "samplerExternalOES";
+}
+
+
namespace Dali
{
return true;
}
-bool NativeImageSourceAndroid::GlExtensionCreate()
+bool NativeImageSourceAndroid::CreateResource()
{
// if the image existed previously delete it.
if( mEglImageKHR != NULL )
{
- GlExtensionDestroy();
+ DestroyResource();
}
DALI_ASSERT_ALWAYS( mPixmap );
return mEglImageKHR != NULL;
}
-void NativeImageSourceAndroid::GlExtensionDestroy()
+void NativeImageSourceAndroid::DestroyResource()
{
mEglImageExtensions->DestroyImageKHR( mEglImageKHR );
{
}
+int NativeImageSourceAndroid::GetTextureTarget() const
+{
+ return GL_TEXTURE_2D;
+}
+
+const char* NativeImageSourceAndroid::GetCustomFragmentPrefix() const
+{
+ return nullptr;
+}
+
+const char* NativeImageSourceAndroid::GetCustomSamplerTypename() const
+{
+ return nullptr;
+}
+
+
void* NativeImageSourceAndroid::GetPixmapFromAny(Any pixmap) const
{
if( pixmap.Empty() )
~NativeImageSourceAndroid() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
return mBlendingRequired;
}
+ /**
+ * @copydoc Dali::NativeImageSource::GetTargetTexture()
+ */
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override
+ {
+ return GetNativeImageSource();
+ }
+
+ /**
+ * @copydoc Dali::NativeImageSource::SourceChanged()
+ */
+ bool SourceChanged() const override
+ {
+ return false;
+ }
+
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
{
}
-bool NativeImageSourceQueueAndroid::GlExtensionCreate()
+bool NativeImageSourceQueueAndroid::CreateResource()
{
return true;
}
-void NativeImageSourceQueueAndroid::GlExtensionDestroy()
+void NativeImageSourceQueueAndroid::DestroyResource()
{
}
{
}
-const char* NativeImageSourceQueueAndroid::GetCustomFragmentPreFix()
+const char* NativeImageSourceQueueAndroid::GetCustomFragmentPrefix() const
{
return FRAGMENT_PREFIX;
}
-const char* NativeImageSourceQueueAndroid::GetCustomSamplerTypename()
+const char* NativeImageSourceQueueAndroid::GetCustomSamplerTypename() const
{
return SAMPLER_TYPE;
}
-int NativeImageSourceQueueAndroid::GetEglImageTextureTarget()
+int NativeImageSourceQueueAndroid::GetTextureTarget() const
{
- return 0;
+ return GL_TEXTURE_2D;
+}
+
+Any NativeImageSourceQueueAndroid::GetNativeImageHandle() const
+{
+ return nullptr;
+}
+
+bool NativeImageSourceQueueAndroid::SourceChanged() const
+{
+ return false;
}
} // namespace Adaptor
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
// INTERNAL INCLUDES
#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
/**
* Dali internal NativeImageSourceQueue.
*/
-class NativeImageSourceQueueAndroid: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
+class NativeImageSourceQueueAndroid: public Internal::Adaptor::NativeImageSourceQueue
{
public:
~NativeImageSourceQueueAndroid() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
{
- return this;
+ return nullptr;
}
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
*/
- const char* GetCustomFragmentPreFix() override;
+ const char* GetCustomFragmentPrefix() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
*/
- const char* GetCustomSamplerTypename() override;
+ const char* GetCustomSamplerTypename() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
- int GetEglImageTextureTarget() override;
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
private:
mBuffer->Write( src, size ); // Write will cause LocklessBuffer to switch to the other buffer
}
-bool NativeBitmapBuffer::GlExtensionCreate()
+bool NativeBitmapBuffer::CreateResource()
{
return true;
}
-void NativeBitmapBuffer::GlExtensionDestroy()
+void NativeBitmapBuffer::DestroyResource()
{
}
return Pixel::HasAlpha( mPixelFormat );
}
+int NativeBitmapBuffer::GetTextureTarget() const
+{
+ return 0;
+}
+
+const char* NativeBitmapBuffer::GetCustomFragmentPrefix() const
+{
+ return nullptr;
+}
+
+const char* NativeBitmapBuffer::GetCustomSamplerTypename() const
+{
+ return nullptr;
+}
+
+Any NativeBitmapBuffer::GetNativeImageHandle() const
+{
+ return nullptr;
+}
+
+bool NativeBitmapBuffer::SourceChanged() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
public:
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- virtual bool GlExtensionCreate();
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- virtual void GlExtensionDestroy();
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual unsigned int TargetTexture();
+ unsigned int TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
*/
- virtual void PrepareTexture();
+ void PrepareTexture() override;
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual unsigned int GetWidth() const;
+ unsigned int GetWidth() const override;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual unsigned int GetHeight() const;
+ unsigned int GetHeight() const override;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
*/
- virtual bool RequiresBlending() const;
+ bool RequiresBlending() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::RequiresBlending()
+ */
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
+
private:
NativeBitmapBuffer( const NativeBitmapBuffer& ); ///< not defined
virtual ~NativeImageSource() = default;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- virtual bool GlExtensionCreate() = 0;
+ virtual bool CreateResource() = 0;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- virtual void GlExtensionDestroy() = 0;
+ virtual void DestroyResource() = 0;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
*/
virtual bool RequiresBlending() const = 0;
+ /**
+ * @copydoc Dali::NativeImageSource::GetTextureTarget()
+ */
+ virtual int GetTextureTarget() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomFragmentPrefix()
+ */
+ virtual const char* GetCustomFragmentPrefix() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
+ */
+ virtual const char* GetCustomSamplerTypename() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetNativeImageHandle()
+ */
+ virtual Any GetNativeImageHandle() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageSource::SourceChanged()
+ */
+ virtual bool SourceChanged() const = 0;
+
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
virtual ~NativeImageSourceQueue() = default;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- virtual bool GlExtensionCreate() = 0;
+ virtual bool CreateResource() = 0;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- virtual void GlExtensionDestroy() = 0;
+ virtual void DestroyResource() = 0;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
virtual bool RequiresBlending() const = 0;
+ /**
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
+ */
+ virtual int GetTextureTarget() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ virtual const char* GetCustomFragmentPrefix() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ virtual const char* GetCustomSamplerTypename() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ virtual Any GetNativeImageHandle() const = 0;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ virtual bool SourceChanged() const = 0;
+
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
return false;
}
-bool NativeImageSourceTizen::GlExtensionCreate()
+bool NativeImageSourceTizen::CreateResource()
{
// casting from an unsigned int to a void *, which should then be cast back
// to an unsigned int in the driver.
return mEglImageKHR != NULL;
}
-void NativeImageSourceTizen::GlExtensionDestroy()
+void NativeImageSourceTizen::DestroyResource()
{
Dali::Mutex::ScopedLock lock( mMutex );
if( mEglImageKHR )
{
void* eglImage = mEglImageKHR;
- if( GlExtensionCreate() )
+ if( CreateResource() )
{
TargetTexture();
}
}
}
-const char* NativeImageSourceTizen::GetCustomFragmentPreFix()
+const char* NativeImageSourceTizen::GetCustomFragmentPrefix() const
{
return FRAGMENT_PREFIX;
}
-const char* NativeImageSourceTizen::GetCustomSamplerTypename()
+const char* NativeImageSourceTizen::GetCustomSamplerTypename() const
{
return SAMPLER_TYPE;
}
-int NativeImageSourceTizen::GetEglImageTextureTarget()
+int NativeImageSourceTizen::GetTextureTarget() const
{
return GL_TEXTURE_EXTERNAL_OES;
}
+Any NativeImageSourceTizen::GetNativeImageHandle() const
+{
+ return GetNativeImageSource();
+}
+
+bool NativeImageSourceTizen::SourceChanged() const
+{
+ return false;
+}
+
bool NativeImageSourceTizen::CheckBlending( tbm_format format )
{
if( mTbmFormat != format )
// EXTERNAL INCLUDES
#include <tbm_surface.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali/devel-api/threading/mutex.h>
#include <dali/public-api/common/dali-vector.h>
/**
* Dali internal NativeImageSource.
*/
-class NativeImageSourceTizen: public Internal::Adaptor::NativeImageSource, public NativeImageInterface::Extension
+class NativeImageSourceTizen: public Internal::Adaptor::NativeImageSource
{
public:
~NativeImageSourceTizen() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
}
/**
- * @copydoc Dali::NativeImageInterface::GetExtension()
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
*/
- NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
- {
- return this;
- }
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
- const char* GetCustomFragmentPreFix() override;
+ int GetTextureTarget() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
*/
- const char* GetCustomSamplerTypename() override;
+ Any GetNativeImageHandle() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
*/
- int GetEglImageTextureTarget() override;
+ bool SourceChanged() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetExtension()
+ */
+ NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+ {
+ return nullptr;
+ }
/**
* @copydoc Dali::Internal::Adaptor::NativeImageSource::AcquireBuffer()
}
}
-bool NativeImageSourceQueueTizen::GlExtensionCreate()
+bool NativeImageSourceQueueTizen::CreateResource()
{
mEglImageExtensions = mEglGraphics->GetImageExtensions();
DALI_ASSERT_DEBUG( mEglImageExtensions );
return true;
}
-void NativeImageSourceQueueTizen::GlExtensionDestroy()
+void NativeImageSourceQueueTizen::DestroyResource()
{
Dali::Mutex::ScopedLock lock( mMutex );
}
}
-const char* NativeImageSourceQueueTizen::GetCustomFragmentPreFix()
+const char* NativeImageSourceQueueTizen::GetCustomFragmentPrefix() const
{
return FRAGMENT_PREFIX;
}
-const char* NativeImageSourceQueueTizen::GetCustomSamplerTypename()
+const char* NativeImageSourceQueueTizen::GetCustomSamplerTypename() const
{
return SAMPLER_TYPE;
}
-int NativeImageSourceQueueTizen::GetEglImageTextureTarget()
+int NativeImageSourceQueueTizen::GetTextureTarget() const
{
return GL_TEXTURE_EXTERNAL_OES;
}
+Any NativeImageSourceQueueTizen::GetNativeImageHandle() const
+{
+ return nullptr;
+}
+
+bool NativeImageSourceQueueTizen::SourceChanged() const
+{
+ return false;
+}
+
+
+
void NativeImageSourceQueueTizen::ResetEglImageList()
{
if( mConsumeSurface )
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali/devel-api/threading/mutex.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <tbm_surface.h>
/**
* Dali internal NativeImageSource.
*/
-class NativeImageSourceQueueTizen: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
+class NativeImageSourceQueueTizen: public Internal::Adaptor::NativeImageSourceQueue
{
public:
~NativeImageSourceQueueTizen() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
}
/**
- * @copydoc Dali::NativeImageInterface::GetExtension()
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
*/
- NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
- {
- return this;
- }
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
- const char* GetCustomFragmentPreFix() override;
+ int GetTextureTarget() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
*/
- const char* GetCustomSamplerTypename() override;
+ Any GetNativeImageHandle() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
*/
- int GetEglImageTextureTarget() override;
+ bool SourceChanged() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetExtension()
+ */
+ NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+ {
+ return nullptr;
+ }
private:
return true;
}
-bool NativeImageSourceX::GlExtensionCreate()
+bool NativeImageSourceX::CreateResource()
{
// if the image existed previously delete it.
if (mEglImageKHR != NULL)
{
- GlExtensionDestroy();
+ DestroyResource();
}
// casting from an unsigned int to a void *, which should then be cast back
return mEglImageKHR != NULL;
}
-void NativeImageSourceX::GlExtensionDestroy()
+void NativeImageSourceX::DestroyResource()
{
mEglImageExtensions->DestroyImageKHR(mEglImageKHR);
}
}
+int NativeImageSourceX::GetTextureTarget() const
+{
+ return GL_TEXTURE_2D;
+}
+
+const char* NativeImageSourceX::GetCustomFragmentPrefix() const
+{
+ return nullptr;
+}
+
+const char* NativeImageSourceX::GetCustomSamplerTypename() const
+{
+ return nullptr;
+}
+
+Any NativeImageSourceX::GetNativeImageHandle() const
+{
+ return Any(mPixmap);
+}
+
+bool NativeImageSourceX::SourceChanged() const
+{
+ return false;
+}
+
Ecore_X_Pixmap NativeImageSourceX::GetPixmapFromAny(Any pixmap) const
{
if (pixmap.Empty())
~NativeImageSourceX() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
return mBlendingRequired;
}
+ /**
+ * @copydoc Dali::NativeImageSource::GetTextureTarget()
+ */
+ virtual int GetTextureTarget() const;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomFragmentPrefix()
+ */
+ virtual const char* GetCustomFragmentPrefix() const;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetCustomSamplerTypename()
+ */
+ virtual const char* GetCustomSamplerTypename() const;
+
+ /**
+ * @copydoc Dali::NativeImageSource::GetNativeImageHandle()
+ */
+ virtual Any GetNativeImageHandle() const;
+
+ /**
+ * @copydoc Dali::NativeImageSource::SourceChanged()
+ */
+ virtual bool SourceChanged() const;
+
+
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
{
}
-bool NativeImageSourceQueueX::GlExtensionCreate()
+bool NativeImageSourceQueueX::CreateResource()
{
return true;
}
-void NativeImageSourceQueueX::GlExtensionDestroy()
+void NativeImageSourceQueueX::DestroyResource()
{
}
{
}
-const char* NativeImageSourceQueueX::GetCustomFragmentPreFix()
+const char* NativeImageSourceQueueX::GetCustomFragmentPrefix() const
{
return FRAGMENT_PREFIX;
}
-const char* NativeImageSourceQueueX::GetCustomSamplerTypename()
+const char* NativeImageSourceQueueX::GetCustomSamplerTypename() const
{
return SAMPLER_TYPE;
}
-int NativeImageSourceQueueX::GetEglImageTextureTarget()
+int NativeImageSourceQueueX::GetTextureTarget() const
{
return 0;
}
+Any NativeImageSourceQueueX::GetNativeImageHandle() const
+{
+ return nullptr;
+}
+
+bool NativeImageSourceQueueX::SourceChanged() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace internal
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
// INTERNAL INCLUDES
#include <dali/internal/imaging/common/native-image-source-queue-impl.h>
/**
* Dali internal NativeImageSourceQueue.
*/
-class NativeImageSourceQueueX: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
+class NativeImageSourceQueueX: public Internal::Adaptor::NativeImageSourceQueue
{
public:
~NativeImageSourceQueueX() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
}
/**
- * @copydoc Dali::NativeImageInterface::GetExtension()
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
*/
- NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
- {
- return this;
- }
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
*/
- const char* GetCustomFragmentPreFix() override;
+ const char* GetCustomSamplerTypename() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
*/
- const char* GetCustomSamplerTypename() override;
+ Any GetNativeImageHandle() const override;
/**
- * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
*/
- int GetEglImageTextureTarget() override;
+ bool SourceChanged() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetExtension()
+ */
+ NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
+ {
+ return nullptr;
+ }
private:
return true;
}
-bool NativeImageSourceWin::GlExtensionCreate()
+bool NativeImageSourceWin::CreateResource()
{
// if the image existed previously delete it.
if (mEglImageKHR != NULL)
{
- GlExtensionDestroy();
+ DestroyResource();
}
// casting from an unsigned int to a void *, which should then be cast back
return mEglImageKHR != NULL;
}
-void NativeImageSourceWin::GlExtensionDestroy()
+void NativeImageSourceWin::DestroyResource()
{
mEglImageExtensions->DestroyImageKHR(mEglImageKHR);
{
}
+const char* NativeImageSourceWin::GetCustomFragmentPrefix() const
+{
+ return nullptr;
+}
+
+const char* NativeImageSourceWin::GetCustomSamplerTypename() const
+{
+ return nullptr;
+}
+
+int NativeImageSourceWin::GetTextureTarget() const
+{
+ return GL_TEXTURE_2D;
+}
+
+Any NativeImageSourceWin::GetNativeImageHandle() const
+{
+ return mPixmap;
+}
+
+bool NativeImageSourceWin::SourceChanged() const
+{
+ return false;
+}
+
uint8_t* NativeImageSourceWin::AcquireBuffer( uint16_t& width, uint16_t& height, uint16_t& stride )
{
return NULL;
~NativeImageSourceWin() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::CreateResource()
*/
- bool GlExtensionCreate() override;
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::DestroyResource()
*/
- void GlExtensionDestroy() override;
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
return mBlendingRequired;
}
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
+ */
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
+
/**
* @copydoc Dali::NativeImageInterface::GetExtension()
*/
return mImpl->IsColorDepthSupported( colorDepth );
}
-bool NativeImageSource::GlExtensionCreate()
+bool NativeImageSource::CreateResource()
{
- return mImpl->GlExtensionCreate();
+ return mImpl->CreateResource();
}
-void NativeImageSource::GlExtensionDestroy()
+void NativeImageSource::DestroyResource()
{
- mImpl->GlExtensionDestroy();
+ mImpl->DestroyResource();
}
unsigned int NativeImageSource::TargetTexture()
return mImpl->RequiresBlending();
}
+int NativeImageSource::GetTextureTarget() const
+{
+ return mImpl->GetTextureTarget();
+}
+
+const char* NativeImageSource::GetCustomFragmentPrefix() const
+{
+ return mImpl->GetCustomFragmentPrefix();
+}
+
+const char* NativeImageSource::GetCustomSamplerTypename() const
+{
+ return mImpl->GetCustomSamplerTypename();
+}
+
+Any NativeImageSource::GetNativeImageHandle() const
+{
+ return mImpl->GetNativeImageHandle();
+}
+
+bool NativeImageSource::SourceChanged() const
+{
+ return mImpl->SourceChanged();
+}
+
NativeImageInterface::Extension* NativeImageSource::GetExtension()
{
return mImpl->GetNativeImageInterfaceExtension();
*/
bool IsColorDepthSupported( ColorDepth colorDepth );
+ /**
+ * @copydoc Dali::NativeImageInterface::GetTextureTarget()
+ */
+ int GetTextureTarget() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomFragmentPrefix()
+ */
+ const char* GetCustomFragmentPrefix() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename() const override;
+
private: // native image
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
+ * @copydoc Dali::NativeImageInterface::CreateResource()
*/
- virtual bool GlExtensionCreate();
+ bool CreateResource() override;
/**
- * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageInterface::DestroyResource()
*/
- virtual void GlExtensionDestroy();
+ void DestroyResource() override;
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual unsigned int TargetTexture();
+ unsigned int TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
*/
- virtual void PrepareTexture();
+ void PrepareTexture() override;
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual unsigned int GetWidth() const;
+ unsigned int GetWidth() const override;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual unsigned int GetHeight() const;
+ unsigned int GetHeight() const override;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
*/
- virtual bool RequiresBlending() const;
+ bool RequiresBlending() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
+ */
+ Any GetNativeImageHandle() const override;
+
+ /**
+ * @copydoc Dali::NativeImageInterface::SourceChanged()
+ */
+ bool SourceChanged() const override;
/**
* @copydoc Dali::NativeImageInterface::GetExtension()