NativeImageSourceFactory() = default;
virtual ~NativeImageSourceFactory() = default;
- virtual std::unique_ptr< NativeImageSource > CreateNativeImageSource( unsigned int width, unsigned int height,
+ virtual std::unique_ptr< NativeImageSource > CreateNativeImageSource( uint32_t width, uint32_t height,
Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) = 0;
- virtual std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
+ virtual std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( uint32_t width, uint32_t height,
Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue ) = 0;
};
* @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSource* New(unsigned int width,
- unsigned int height,
+ static NativeImageSource* New(uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
/**
/**
* @copydoc Dali::NativeImageSource::GetPixels()
*/
- virtual bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const = 0;
+ virtual bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const = 0;
/**
* @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
*/
- virtual unsigned int TargetTexture() = 0;
+ virtual uint32_t TargetTexture() = 0;
/**
* @copydoc Dali::NativeImageSource::PrepareTexture()
/**
* @copydoc Dali::NativeImageSource::GetWidth()
*/
- virtual unsigned int GetWidth() const = 0;
+ virtual uint32_t GetWidth() const = 0;
/**
* @copydoc Dali::NativeImageSource::GetHeight()
*/
- virtual unsigned int GetHeight() const = 0;
+ virtual uint32_t GetHeight() const = 0;
/**
* @copydoc Dali::NativeImageSource::RequiresBlending()
/**
* @copydoc Dali::NativeImageSourceQueue::New()
*/
- static NativeImageSourceQueue* New( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+ static NativeImageSourceQueue* New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
/**
* @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
virtual Any GetNativeImageSourceQueue() const = 0;
/**
- * @copydoc Dali::NativeImageSourceQueue::SetSource( Any source )
+ * @copydoc Dali::NativeImageSourceQueue::SetSize
*/
- virtual void SetSource( Any source ) = 0;
+ virtual void SetSize( uint32_t width, uint32_t height ) = 0;
/**
* destructor
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual unsigned int TargetTexture() = 0;
+ virtual uint32_t TargetTexture() = 0;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual unsigned int GetWidth() const = 0;
+ virtual uint32_t GetWidth() const = 0;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual unsigned int GetHeight() const = 0;
+ virtual uint32_t GetHeight() const = 0;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
namespace Dali
{
-NativeImageSourceQueuePtr NativeImageSourceQueue::New( unsigned int width, unsigned int height, ColorDepth depth )
+NativeImageSourceQueuePtr NativeImageSourceQueue::New( uint32_t width, uint32_t height, ColorDepth depth )
{
Any empty;
NativeImageSourceQueuePtr image = new NativeImageSourceQueue( width, height, depth, empty );
return mImpl->GetNativeImageSourceQueue();
}
-void NativeImageSourceQueue::SetSource( Any source )
+void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height )
{
- mImpl->SetSource( source );
+ return mImpl->SetSize( width, height );
}
bool NativeImageSourceQueue::GlExtensionCreate()
mImpl->GlExtensionDestroy();
}
-unsigned int NativeImageSourceQueue::TargetTexture()
+uint32_t NativeImageSourceQueue::TargetTexture()
{
return mImpl->TargetTexture();
}
mImpl->PrepareTexture();
}
-unsigned int NativeImageSourceQueue::GetWidth() const
+uint32_t NativeImageSourceQueue::GetWidth() const
{
return mImpl->GetWidth();
}
-unsigned int NativeImageSourceQueue::GetHeight() const
+uint32_t NativeImageSourceQueue::GetHeight() const
{
return mImpl->GetHeight();
}
return mImpl->GetNativeImageInterfaceExtension();
}
-NativeImageSourceQueue::NativeImageSourceQueue( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSourceQueue )
+NativeImageSourceQueue::NativeImageSourceQueue( uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue )
{
auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
mImpl = factory->CreateNativeImageSourceQueue( width, height, depth, nativeImageSourceQueue );
* @param[in] depth color depth of the image
* @return A smart-pointer to a newly allocated image
*/
- static NativeImageSourceQueuePtr New( unsigned int width, unsigned int height, ColorDepth depth );
+ static NativeImageSourceQueuePtr New( uint32_t width, uint32_t height, ColorDepth depth );
/**
* @brief Creates a new NativeImageSourceQueue from an existing native image source.
Any GetNativeImageSourceQueue();
/**
- * @brief Sets an existing source.
+ * @brief Sets the size of the image.
*
- * @param[in] source Any handle with the source
+ * @param[in] width The width of the image
+ * @param[in] height The height of the image
*/
- void SetSource( Any source );
+ void SetSize( uint32_t width, uint32_t height );
private: // native image
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- virtual unsigned int TargetTexture();
+ virtual uint32_t TargetTexture();
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- virtual unsigned int GetWidth() const;
+ virtual uint32_t GetWidth() const;
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- virtual unsigned int GetHeight() const;
+ virtual uint32_t GetHeight() const;
/**
* @copydoc Dali::NativeImageInterface::RequiresBlending()
* @param[in] depth color depth of the image
* @param[in] nativeImageSourceQueue contains either: native image source or is empty
*/
- DALI_INTERNAL NativeImageSourceQueue( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSourceQueue );
+ DALI_INTERNAL NativeImageSourceQueue( uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
namespace Adaptor
{
-std::unique_ptr< NativeImageSource > NativeImageSourceFactoryTizen::CreateNativeImageSource( unsigned int width, unsigned int height,
+std::unique_ptr< NativeImageSource > NativeImageSourceFactoryTizen::CreateNativeImageSource( uint32_t width, uint32_t height,
Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
return std::unique_ptr< NativeImageSource >( NativeImageSourceTizen::New( width, height, depth, nativeImageSource ) );
}
-std::unique_ptr< NativeImageSourceQueue > NativeImageSourceFactoryTizen::CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
+std::unique_ptr< NativeImageSourceQueue > NativeImageSourceFactoryTizen::CreateNativeImageSourceQueue( uint32_t width, uint32_t height,
Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
{
return std::unique_ptr< NativeImageSourceQueue >( NativeImageSourceQueueTizen::New( width, height, depth, nativeImageSourceQueue ) );
{
public:
- std::unique_ptr< NativeImageSource > CreateNativeImageSource( unsigned int width, unsigned int height,
+ std::unique_ptr< NativeImageSource > CreateNativeImageSource( uint32_t width, uint32_t height,
Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) override;
- std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
+ std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( uint32_t width, uint32_t height,
Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue ) override;
};
using Dali::Integration::PixelBuffer;
-NativeImageSourceTizen* NativeImageSourceTizen::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceTizen* NativeImageSourceTizen::New( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
NativeImageSourceTizen* image = new NativeImageSourceTizen( width, height, depth, nativeImageSource );
DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." );
return image;
}
-NativeImageSourceTizen::NativeImageSourceTizen( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceTizen::NativeImageSourceTizen( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
: mWidth( width ),
mHeight( height ),
mOwnTbmSurface( false ),
}
}
-unsigned int NativeImageSourceTizen::TargetTexture()
+uint32_t NativeImageSourceTizen::TargetTexture()
{
mEglImageExtensions->TargetTextureKHR(mEglImageKHR);
* @param[in] nativeImageSource contains tbm_surface_h or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSourceTizen* New(unsigned int width,
- unsigned int height,
+ static NativeImageSourceTizen* New(uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
/**
* @copydoc Dali::NativeImageSource::GetPixels()
*/
- bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const override;
+ bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
/**
* @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
*/
- unsigned int TargetTexture() override;
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageSource::PrepareTexture()
/**
* @copydoc Dali::NativeImageSource::GetWidth()
*/
- unsigned int GetWidth() const override
+ uint32_t GetWidth() const override
{
return mWidth;
}
/**
* @copydoc Dali::NativeImageSource::GetHeight()
*/
- unsigned int GetHeight() const override
+ uint32_t GetHeight() const override
{
return mHeight;
}
* @param[in] colour depth of the image.
* @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- NativeImageSourceTizen(unsigned int width,
+ NativeImageSourceTizen(uint32_t width,
unsigned int height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
private:
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image height
+ 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;
}
-NativeImageSourceQueueTizen* NativeImageSourceQueueTizen::New( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+NativeImageSourceQueueTizen* NativeImageSourceQueueTizen::New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
{
NativeImageSourceQueueTizen* image = new NativeImageSourceQueueTizen( width, height, depth, nativeImageSourceQueue );
DALI_ASSERT_DEBUG( image && "NativeImageSourceQueueTizen allocation failed." );
return image;
}
-NativeImageSourceQueueTizen::NativeImageSourceQueueTizen( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
-: mWidth( width ),
+NativeImageSourceQueueTizen::NativeImageSourceQueueTizen( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+: mMutex(),
+ mWidth( width ),
mHeight( height ),
mTbmQueue( NULL ),
mConsumeSurface( NULL ),
{
if( mOwnTbmQueue )
{
- DestroyQueue();
+ if( mTbmQueue != NULL )
+ {
+ tbm_surface_queue_destroy( mTbmQueue );
+ }
}
}
void NativeImageSourceQueueTizen::Initialize( Dali::NativeImageSourceQueue::ColorDepth depth )
{
- if( mTbmQueue != NULL || mWidth == 0 || mHeight == 0 )
+ if( mWidth == 0 || mHeight == 0 )
{
return;
}
- int format = TBM_FORMAT_ARGB8888;
-
- switch( depth )
+ if( mTbmQueue == NULL )
{
- case Dali::NativeImageSourceQueue::COLOR_DEPTH_DEFAULT:
- case Dali::NativeImageSourceQueue::COLOR_DEPTH_32:
- {
- format = TBM_FORMAT_ARGB8888;
- mBlendingRequired = true;
- break;
- }
- case Dali::NativeImageSourceQueue::COLOR_DEPTH_24:
- {
- format = TBM_FORMAT_RGB888;
- mBlendingRequired = false;
- break;
- }
- default:
+ int format = TBM_FORMAT_ARGB8888;
+
+ switch( depth )
{
- DALI_LOG_WARNING( "Wrong color depth.\n" );
- return;
+ case Dali::NativeImageSourceQueue::COLOR_DEPTH_DEFAULT:
+ case Dali::NativeImageSourceQueue::COLOR_DEPTH_32:
+ {
+ format = TBM_FORMAT_ARGB8888;
+ mBlendingRequired = true;
+ break;
+ }
+ case Dali::NativeImageSourceQueue::COLOR_DEPTH_24:
+ {
+ format = TBM_FORMAT_RGB888;
+ mBlendingRequired = false;
+ break;
+ }
+ default:
+ {
+ DALI_LOG_WARNING( "Wrong color depth.\n" );
+ return;
+ }
}
- }
- mTbmQueue = tbm_surface_queue_create( TBM_SURFACE_QUEUE_SIZE, mWidth, mHeight, format, 0 );
+ mTbmQueue = tbm_surface_queue_create( TBM_SURFACE_QUEUE_SIZE, mWidth, mHeight, format, 0 );
- mOwnTbmQueue = true;
+ mOwnTbmQueue = true;
+ }
}
tbm_surface_queue_h NativeImageSourceQueueTizen::GetSurfaceFromAny( Any source ) const
return Any( mTbmQueue );
}
-void NativeImageSourceQueueTizen::SetSource( Any source )
+void NativeImageSourceQueueTizen::SetSize( uint32_t width, uint32_t height )
{
- if( mOwnTbmQueue )
- {
- DestroyQueue();
- }
+ Dali::Mutex::ScopedLock lock( mMutex );
- mTbmQueue = GetSurfaceFromAny( source );
+ tbm_surface_queue_reset( mTbmQueue, width, height, tbm_surface_queue_get_format( mTbmQueue ) );
- if( mTbmQueue != NULL )
- {
- mBlendingRequired = CheckBlending( tbm_surface_queue_get_format( mTbmQueue ) );
- mWidth = tbm_surface_queue_get_width( mTbmQueue );
- mHeight = tbm_surface_queue_get_height( mTbmQueue );
- }
+ mWidth = width;
+ mHeight = height;
+
+ ResetEglImageList();
}
bool NativeImageSourceQueueTizen::GlExtensionCreate()
void NativeImageSourceQueueTizen::GlExtensionDestroy()
{
- for( auto&& iter : mEglImages )
- {
- mEglImageExtensions->DestroyImageKHR( iter.second );
+ Dali::Mutex::ScopedLock lock( mMutex );
- tbm_surface_internal_unref( iter.first );
- }
- mEglImages.clear();
+ ResetEglImageList();
}
-unsigned int NativeImageSourceQueueTizen::TargetTexture()
+uint32_t NativeImageSourceQueueTizen::TargetTexture()
{
return 0;
}
void NativeImageSourceQueueTizen::PrepareTexture()
{
+ Dali::Mutex::ScopedLock lock( mMutex );
+
tbm_surface_h oldSurface = mConsumeSurface;
if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) )
{
}
-void NativeImageSourceQueueTizen::DestroyQueue()
+void NativeImageSourceQueueTizen::ResetEglImageList()
{
if( mConsumeSurface )
{
- tbm_surface_internal_unref( mConsumeSurface );
-
if( tbm_surface_internal_is_valid( mConsumeSurface ) )
{
tbm_surface_queue_release( mTbmQueue, mConsumeSurface );
}
+ mConsumeSurface = NULL;
}
- if( mTbmQueue != NULL )
+ for( auto&& iter : mEglImages )
{
- tbm_surface_queue_destroy( mTbmQueue );
- }
+ mEglImageExtensions->DestroyImageKHR( iter.second );
- mTbmQueue = NULL;
- mOwnTbmQueue = false;
+ tbm_surface_internal_unref( iter.first );
+ }
+ mEglImages.clear();
}
bool NativeImageSourceQueueTizen::CheckBlending( int format )
// 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>
#include <tbm_surface_queue.h>
* @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSourceQueueTizen* New(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+ static NativeImageSourceQueueTizen* New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
/**
* @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
Any GetNativeImageSourceQueue() const override;
/**
- * @copydoc Dali::NativeImageSourceQueue::SetSource( Any source )
+ * @copydoc Dali::NativeImageSourceQueue::SetSize
*/
- void SetSource( Any source ) override;
+ void SetSize( uint32_t width, uint32_t height ) override;
/**
* destructor
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- unsigned int TargetTexture() override;
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- unsigned int GetWidth() const override
+ uint32_t GetWidth() const override
{
return mWidth;
}
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- unsigned int GetHeight() const override
+ uint32_t GetHeight() const override
{
return mHeight;
}
* @param[in] colour depth of the image.
* @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
*/
- NativeImageSourceQueueTizen( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+ NativeImageSourceQueueTizen( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
void Initialize( Dali::NativeImageSourceQueue::ColorDepth depth );
- void DestroyQueue();
+ void ResetEglImageList();
tbm_surface_queue_h GetSurfaceFromAny( Any source ) const;
typedef std::pair< tbm_surface_h, void* > EglImagePair;
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image height
+ 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
namespace Adaptor
{
-std::unique_ptr< NativeImageSource > NativeImageSourceFactoryX::CreateNativeImageSource( unsigned int width, unsigned int height,
+std::unique_ptr< NativeImageSource > NativeImageSourceFactoryX::CreateNativeImageSource( uint32_t width, uint32_t height,
Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
return std::unique_ptr< NativeImageSource >( NativeImageSourceX::New( width, height, depth, nativeImageSource ) );
}
-std::unique_ptr< NativeImageSourceQueue > NativeImageSourceFactoryX::CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
+std::unique_ptr< NativeImageSourceQueue > NativeImageSourceFactoryX::CreateNativeImageSourceQueue( uint32_t width, uint32_t height,
Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
{
return std::unique_ptr< NativeImageSourceQueue >( NativeImageSourceQueueX::New( width, height, depth, nativeImageSourceQueue ) );
{
public:
- std::unique_ptr< NativeImageSource > CreateNativeImageSource( unsigned int width, unsigned int height,
+ std::unique_ptr< NativeImageSource > CreateNativeImageSource( uint32_t width, uint32_t height,
Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource ) override;
- std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( unsigned int width, unsigned int height,
+ std::unique_ptr< NativeImageSourceQueue > CreateNativeImageSourceQueue( uint32_t width, uint32_t height,
Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue ) override;
};
};
}
-NativeImageSourceX* NativeImageSourceX::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceX* NativeImageSourceX::New( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
NativeImageSourceX* image = new NativeImageSourceX( width, height, depth, nativeImageSource );
DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." );
return image;
}
-NativeImageSourceX::NativeImageSourceX( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceX::NativeImageSourceX( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
: mWidth( width ),
mHeight( height ),
mOwnPixmap( true ),
mEglImageKHR = NULL;
}
-unsigned int NativeImageSourceX::TargetTexture()
+uint32_t NativeImageSourceX::TargetTexture()
{
mEglImageExtensions->TargetTextureKHR(mEglImageKHR);
* @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSourceX* New(unsigned int width,
- unsigned int height,
+ static NativeImageSourceX* New( uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
/**
/**
* @copydoc Dali::NativeImageSource::GetPixels()
*/
- bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const override;
+ bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
/**
* @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
/**
* @copydoc Dali::NativeImageSource::TargetTexture()
*/
- unsigned int TargetTexture() override;
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageSource::PrepareTexture()
/**
* @copydoc Dali::NativeImageSource::GetWidth()
*/
- unsigned int GetWidth() const override
+ uint32_t GetWidth() const override
{
return mWidth;
}
/**
* @copydoc Dali::NativeImageSource::GetHeight()
*/
- unsigned int GetHeight() const override
+ uint32_t GetHeight() const override
{
return mHeight;
}
* @param[in] colour depth of the image.
* @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- NativeImageSourceX(unsigned int width,
- unsigned int height,
+ NativeImageSourceX( uint32_t width,
+ uint32_t height,
Dali::NativeImageSource::ColorDepth depth,
Any nativeImageSource);
private:
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image heights
+ uint32_t mWidth; ///< image width
+ uint32_t mHeight; ///< image heights
bool mOwnPixmap; ///< Whether we created pixmap or not
Ecore_X_Pixmap mPixmap; ///< From Xlib
bool mBlendingRequired; ///< Whether blending is required
}
-NativeImageSourceQueueX* NativeImageSourceQueueX::New( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+NativeImageSourceQueueX* NativeImageSourceQueueX::New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
{
NativeImageSourceQueueX* image = new NativeImageSourceQueueX( width, height, depth, nativeImageSourceQueue );
return image;
}
-NativeImageSourceQueueX::NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
+NativeImageSourceQueueX::NativeImageSourceQueueX( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue )
: mWidth( width ),
mHeight( height )
{
return Any();
}
-void NativeImageSourceQueueX::SetSource( Any source )
+void NativeImageSourceQueueX::SetSize( uint32_t width, uint32_t height )
{
+ mWidth = width;
+ mHeight = height;
}
bool NativeImageSourceQueueX::GlExtensionCreate()
{
}
-unsigned int NativeImageSourceQueueX::TargetTexture()
+uint32_t NativeImageSourceQueueX::TargetTexture()
{
return 0;
}
* @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
* @return A smart-pointer to a newly allocated image.
*/
- static NativeImageSourceQueueX* New(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+ static NativeImageSourceQueueX* New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
/**
* @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
Any GetNativeImageSourceQueue() const override;
/**
- * @copydoc Dali::NativeImageSourceQueue::SetSource( Any source )
+ * @copydoc Dali::NativeImageSourceQueue::SetSize
*/
- void SetSource( Any source ) override;
+ void SetSize( uint32_t width, uint32_t height ) override;
/**
* destructor
/**
* @copydoc Dali::NativeImageInterface::TargetTexture()
*/
- unsigned int TargetTexture() override;
+ uint32_t TargetTexture() override;
/**
* @copydoc Dali::NativeImageInterface::PrepareTexture()
/**
* @copydoc Dali::NativeImageInterface::GetWidth()
*/
- unsigned int GetWidth() const override
+ uint32_t GetWidth() const override
{
return mWidth;
}
/**
* @copydoc Dali::NativeImageInterface::GetHeight()
*/
- unsigned int GetHeight() const override
+ uint32_t GetHeight() const override
{
return mHeight;
}
* @param[in] colour depth of the image.
* @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
*/
- NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
+ NativeImageSourceQueueX( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
private:
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image height
+ uint32_t mWidth; ///< image width
+ uint32_t mHeight; ///< image height
};