*/
// EXTERNAL INCLUDES
+#include <tbm_surface.h>
+#include <dali/devel-api/images/native-image-interface-extension.h>
// INTERNAL INCLUDES
#include <native-image-source.h>
/**
* Dali internal NativeImageSource.
*/
-class NativeImageSource
+class NativeImageSource: public NativeImageInterface::Extension
{
public:
bool EncodeToFile(const std::string& filename) const;
/**
+ * @copydoc Dali::NativeImageSource::SetNativeImageSource( Any nativeImageSource )
+ */
+ void SetNativeImageSource( Any nativeImageSource );
+
+ /**
* destructor
*/
~NativeImageSource();
return mBlendingRequired;
}
+ /**
+ * @copydoc Dali::NativeImageInterface::GetExtension()
+ */
+ NativeImageInterface::Extension* GetNativeImageInterfaceExtension()
+ {
+ return this;
+ }
+
+ /**
+ * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
+ */
+ const char* GetCustomFragmentPreFix();
+
+ /**
+ * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
+ */
+ const char* GetCustomSamplerTypename();
+
private:
/**
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
- /**
- * 2nd phase construction.
- */
void Initialize();
- /**
- * Decide whether blending is required based on the color depth.
- * @param depth the PixelImage depth enum
- */
- void SetBlending(Dali::NativeImageSource::ColorDepth depth);
+ int GetPixelDepth(Dali::NativeImageSource::ColorDepth depth) const;
+
+ tbm_surface_h GetSurfaceFromAny( Any source ) const;
private:
unsigned int mWidth; ///< image width
unsigned int mHeight; ///< image heights
- bool mOwnPixmap; ///< Whether we created pixmap or not
+ bool mOwnTbmsurface; ///< Whether we created pixmap or not
+ tbm_surface_h mTbmsurface;
bool mBlendingRequired; ///< Whether blending is required
Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
void* mEglImageKHR; ///< From EGL extension