/**
* The IndicatorBuffer class uses the best available implementation for rendering indicator data.
- * On platforms where EglImage is available it uses either SharedGlBuffer or PixmapImage, on older
+ * On platforms where EglImage is available it uses either SharedGlBuffer or NativeImageSource, on older
* platforms it falls back to using a bitmap buffer based solution.
*/
class IndicatorBuffer : public RefObject
// INTERNAL INCLUDES
#include <adaptor-impl.h>
#include <accessibility-adaptor-impl.h>
-#include <pixmap-image.h>
+#include <native-image-source.h>
using Dali::Vector4;
void Indicator::CreateNewPixmapImage()
{
DALI_LOG_TRACE_METHOD_FMT( gIndicatorLogFilter, "W:%d H:%d", mImageWidth, mImageHeight );
- Dali::PixmapImagePtr pixmapImage = Dali::PixmapImage::New( mPixmap );
+ Dali::NativeImageSourcePtr nativeImageSource = Dali::NativeImageSource::New( mPixmap );
- if( pixmapImage )
+ if( nativeImageSource )
{
- mIndicatorImageActor.SetImage( Dali::NativeImage::New(*pixmapImage) );
+ mIndicatorImageActor.SetImage( Dali::NativeImage::New(*nativeImageSource) );
mIndicatorImageActor.SetSize( mImageWidth, mImageHeight );
mIndicatorActor.SetSize( mImageWidth, mImageHeight );
mEventActor.SetSize(mImageWidth, mImageHeight);
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <native-image-source.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+
+// INTERNAL INCLUDES
+#include <native-image-source-impl.h>
+
+namespace Dali
+{
+
+NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
+{
+ Any empty;
+ NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
+ return image;
+}
+
+Any NativeImageSource::GetNativeImageSource()
+{
+ return mImpl->GetNativeImageSource();
+}
+
+NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource )
+{
+ NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
+ return image;
+}
+
+bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
+{
+ return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
+}
+
+bool NativeImageSource::EncodeToFile(const std::string& filename) const
+{
+ return mImpl->EncodeToFile(filename);
+}
+
+bool NativeImageSource::GlExtensionCreate()
+{
+ return mImpl->GlExtensionCreate();
+}
+
+void NativeImageSource::GlExtensionDestroy()
+{
+ mImpl->GlExtensionDestroy();
+}
+
+unsigned int NativeImageSource::TargetTexture()
+{
+ return mImpl->TargetTexture();
+}
+
+void NativeImageSource::PrepareTexture()
+{
+
+}
+
+unsigned int NativeImageSource::GetWidth() const
+{
+ return mImpl->GetWidth();
+}
+
+unsigned int NativeImageSource::GetHeight() const
+{
+ return mImpl->GetHeight();
+}
+
+bool NativeImageSource::RequiresBlending() const
+{
+ return mImpl->RequiresBlending();
+}
+
+NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
+{
+ mImpl = Internal::Adaptor::NativeImageSource::New( width, height, depth, nativeImageSource );
+}
+
+NativeImageSource::~NativeImageSource()
+{
+ delete mImpl;
+}
+
+} // namespace Dali
-#ifndef __DALI_PIXMAP_IMAGE_H__
-#define __DALI_PIXMAP_IMAGE_H__
+#ifndef __DALI_NATIVE_IMAGE_SOURCE_H__
+#define __DALI_NATIVE_IMAGE_SOURCE_H__
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
{
namespace Adaptor
{
-class PixmapImage;
+class NativeImageSource;
}
}
-class PixmapImage;
+class NativeImageSource;
/**
- * @brief Pointer to Dali::PixmapImage.
+ * @brief Pointer to Dali::NativeImageSource.
*/
-typedef IntrusivePtr<PixmapImage> PixmapImagePtr;
+typedef IntrusivePtr<NativeImageSource> NativeImageSourcePtr;
/**
- * @brief Used for displaying native Pixmap images.
+ * @brief Used for displaying native images.
*
- * The native pixmap can be created internally or
+ * The native image source can be created internally or
* externally by X11 or ECORE-X11.
*
* @since DALi 1.1.4
*/
-class DALI_IMPORT_API PixmapImage : public NativeImageInterface
+class DALI_IMPORT_API NativeImageSource : public NativeImageInterface
{
public:
/**
- * @brief When creating a pixmap the color depth has to be specified.
+ * @brief When creating a native image the color depth has to be specified.
*/
enum ColorDepth
{
};
/**
- * @brief Create a new PixmapImage.
+ * @brief Create a new NativeImageSource.
*
* Depending on hardware the width and height may have to be a power of two.
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] depth color depth of the pixmap
+ * @param[in] depth color depth of the image.
* @return A smart-pointer to a newly allocated image.
*/
- static PixmapImagePtr New( unsigned int width, unsigned int height, ColorDepth depth );
+ static NativeImageSourcePtr New( unsigned int width, unsigned int height, ColorDepth depth );
/**
- * @brief Create a new PixmapImage from an existing pixmap.
+ * @brief Create a new NativeImageSource from an existing native image.
*
- * @param[in] pixmap must be a X11 pixmap or a Ecore_X_Pixmap
+ * @param[in] nativeImageSource must be a X11 pixmap or a Ecore_X_Pixmap
* @return A smart-pointer to a newly allocated image.
*/
- static PixmapImagePtr New( Any pixmap );
+ static NativeImageSourcePtr New( Any nativeImageSource );
/**
- * @brief Retrieve the internal pixmap
+ * @brief Retrieve the internal native image.
*
- * @return pixmap any object containing the internal pixmap
+ * @return Any object containing the internal native image.
*/
- Any GetPixmap();
+ Any GetNativeImageSource();
/**
- * @brief Get a copy of the pixels used by PixmapImage.
+ * @brief Get a copy of the pixels used by NativeImageSource.
*
* This is only supported for 24 bit RGB and 32 bit RGBA internal formats
* (COLOR_DEPTH_24 and COLOR_DEPTH_32).
* @brief Private constructor
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] depth color depth of the pixmap
- * @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
+ * @param[in] depth color depth of the image.
+ * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- DALI_INTERNAL PixmapImage( unsigned int width, unsigned int height, ColorDepth depth, Any pixmap );
+ DALI_INTERNAL NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*
* The implementation should destroy the NativeImage resources.
*/
- DALI_INTERNAL virtual ~PixmapImage();
+ DALI_INTERNAL virtual ~NativeImageSource();
/**
* @brief Undefined copy constructor
*
* This avoids accidental calls to a default copy constructor.
- * @param[in] pixmapImage A reference to the object to copy.
+ * @param[in] nativeImageSource A reference to the object to copy.
*/
- DALI_INTERNAL PixmapImage( const PixmapImage& pixmapImage );
+ DALI_INTERNAL NativeImageSource( const NativeImageSource& nativeImageSource );
/**
* @brief Undefined assignment operator.
* This avoids accidental calls to a default assignment operator.
* @param[in] rhs A reference to the object to copy.
*/
- DALI_INTERNAL PixmapImage& operator=(const PixmapImage& rhs);
+ DALI_INTERNAL NativeImageSource& operator=(const NativeImageSource& rhs);
private:
- Internal::Adaptor::PixmapImage* mImpl; ///< Implementation pointer
+ Internal::Adaptor::NativeImageSource* mImpl; ///< Implementation pointer
};
/**
*/
} // namespace Dali
-#endif // __DALI_PIXMAP_IMAGE_H__
+#endif // __DALI_NATIVE_IMAGE_SOURCE_H__
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <pixmap-image.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/any.h>
-
-// INTERNAL INCLUDES
-#include <pixmap-image-impl.h>
-
-namespace Dali
-{
-
-PixmapImagePtr PixmapImage::New( unsigned int width, unsigned int height, ColorDepth depth )
-{
- Any empty;
- PixmapImagePtr image = new PixmapImage( width, height, depth, empty );
- return image;
-}
-
-Any PixmapImage::GetPixmap()
-{
- return mImpl->GetPixmap();
-}
-
-PixmapImagePtr PixmapImage::New( Any pixmap )
-{
- PixmapImagePtr image = new PixmapImage(0, 0, COLOR_DEPTH_DEFAULT, pixmap);
- return image;
-}
-
-bool PixmapImage::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
-{
- return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
-}
-
-bool PixmapImage::EncodeToFile(const std::string& filename) const
-{
- return mImpl->EncodeToFile(filename);
-}
-
-bool PixmapImage::GlExtensionCreate()
-{
- return mImpl->GlExtensionCreate();
-}
-
-void PixmapImage::GlExtensionDestroy()
-{
- mImpl->GlExtensionDestroy();
-}
-
-unsigned int PixmapImage::TargetTexture()
-{
- return mImpl->TargetTexture();
-}
-
-void PixmapImage::PrepareTexture()
-{
-
-}
-
-unsigned int PixmapImage::GetWidth() const
-{
- return mImpl->GetWidth();
-}
-
-unsigned int PixmapImage::GetHeight() const
-{
- return mImpl->GetHeight();
-}
-
-bool PixmapImage::RequiresBlending() const
-{
- return mImpl->RequiresBlending();
-}
-
-PixmapImage::PixmapImage( unsigned int width, unsigned int height, ColorDepth depth, Any pixmap )
-{
- mImpl = Internal::Adaptor::PixmapImage::New( width, height, depth, pixmap );
-}
-
-PixmapImage::~PixmapImage()
-{
- delete mImpl;
-}
-
-} // namespace Dali
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/adaptor-framework/tts-player.h>
-#include <dali/public-api/adaptor-framework/pixmap-image.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/dali-adaptor-version.h>
#endif //__DALI_H__
$(adaptor_public_api_dir)/adaptor-framework/window.cpp \
$(adaptor_public_api_dir)/adaptor-framework/timer.cpp \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.cpp \
- $(adaptor_public_api_dir)/adaptor-framework/pixmap-image.cpp \
+ $(adaptor_public_api_dir)/adaptor-framework/native-image-source.cpp \
$(adaptor_public_api_dir)/dali-adaptor-version.cpp
$(adaptor_public_api_dir)/adaptor-framework/style-change.h \
$(adaptor_public_api_dir)/adaptor-framework/timer.h \
$(adaptor_public_api_dir)/adaptor-framework/tts-player.h \
- $(adaptor_public_api_dir)/adaptor-framework/pixmap-image.h \
+ $(adaptor_public_api_dir)/adaptor-framework/native-image-source.h \
$(adaptor_public_api_dir)/adaptor-framework/window.h
adaptor_dali_header_file = \
$(adaptor_wayland_dir)/display-connection-impl-wl.cpp \
$(adaptor_wayland_dir)/framework-wl.cpp \
$(adaptor_wayland_dir)/imf-manager-impl-wl.cpp \
- $(adaptor_wayland_dir)/pixmap-image-impl-wl.cpp \
+ $(adaptor_wayland_dir)/native-image-source-impl-wl.cpp \
$(adaptor_wayland_dir)/virtual-keyboard-impl-wl.cpp \
$(adaptor_wayland_dir)/window-impl-wl.cpp \
$(adaptor_wayland_dir)/event-handler-wl.cpp \
*/
// CLASS HEADER
-#include "pixmap-image-impl.h"
+#include "native-image-source-impl.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
{
using Dali::Integration::PixelBuffer;
-PixmapImage* PixmapImage::New(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Any pixmap )
+NativeImageSource* NativeImageSource::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
- PixmapImage* image = new PixmapImage( width, height, depth, pixmap );
- DALI_ASSERT_DEBUG( image && "PixmapImage allocation failed." );
+ NativeImageSource* image = new NativeImageSource( width, height, depth, nativeImageSource );
+ DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." );
// 2nd phase construction
if(image) //< Defensive in case we ever compile without exceptions.
return image;
}
-PixmapImage::PixmapImage( unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Any pixmap )
+NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
: mWidth( width ),
mHeight( height ),
mOwnPixmap( true ),
DALI_ASSERT_DEBUG( mEglImageExtensions );
}
-void PixmapImage::Initialize()
+void NativeImageSource::Initialize()
{
}
-PixmapImage::~PixmapImage()
+NativeImageSource::~NativeImageSource()
{
}
-Any PixmapImage::GetPixmap() const
+Any NativeImageSource::GetNativeImageSource() const
{
- DALI_ASSERT_ALWAYS( false && "PixmapImage::GetPixmap() is not supported for Wayland." );
+ DALI_ASSERT_ALWAYS( false && "NativeImageSource::GetNativeImageSource() is not supported for Wayland." );
return Any();
}
-bool PixmapImage::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
{
return false;
}
-bool PixmapImage::EncodeToFile(const std::string& filename) const
+bool NativeImageSource::EncodeToFile(const std::string& filename) const
{
std::vector< unsigned char > pixbuf;
unsigned int width(0), height(0);
return false;
}
-bool PixmapImage::GlExtensionCreate()
+bool NativeImageSource::GlExtensionCreate()
{
return false;
}
-void PixmapImage::GlExtensionDestroy()
+void NativeImageSource::GlExtensionDestroy()
{
mEglImageExtensions->DestroyImageKHR(mEglImageKHR);
mEglImageKHR = NULL;
}
-unsigned int PixmapImage::TargetTexture()
+unsigned int NativeImageSource::TargetTexture()
{
mEglImageExtensions->TargetTextureKHR(mEglImageKHR);
return 0;
}
-void PixmapImage::SetBlending(Dali::PixmapImage::ColorDepth depth)
+void NativeImageSource::SetBlending(Dali::NativeImageSource::ColorDepth depth)
{
switch (depth)
{
- case Dali::PixmapImage::COLOR_DEPTH_16: //Pixel::RGB565
- case Dali::PixmapImage::COLOR_DEPTH_24: // Pixel::RGB888
+ case Dali::NativeImageSource::COLOR_DEPTH_16: //Pixel::RGB565
+ case Dali::NativeImageSource::COLOR_DEPTH_24: // Pixel::RGB888
{
mBlendingRequired = false;
break;
}
- case Dali::PixmapImage::COLOR_DEPTH_8: //Pixel::A8
- case Dali::PixmapImage::COLOR_DEPTH_32: // Pixel::RGBA8888
+ case Dali::NativeImageSource::COLOR_DEPTH_8: //Pixel::A8
+ case Dali::NativeImageSource::COLOR_DEPTH_32: // Pixel::RGBA8888
{
mBlendingRequired = true;
break;
}
}
-void PixmapImage::GetPixmapDetails()
-{
-}
-
} // namespace Adaptor
} // namespace internal
-#ifndef __DALI_INTERNAL_PIXMAP_IMAGE_H__
-#define __DALI_INTERNAL_PIXMAP_IMAGE_H__
+#ifndef __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
+#define __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
// EXTERNAL INCLUDES
// INTERNAL INCLUDES
-#include <pixmap-image.h>
+#include <native-image-source.h>
namespace Dali
{
class EglImageExtensions;
/**
- * Dali internal PixmapImage.
+ * Dali internal NativeImageSource.
*/
-class PixmapImage
+class NativeImageSource
{
public:
/**
- * Create a new PixmapImage internally.
+ * Create a new NativeImageSource internally.
* Depending on hardware the width and height may have to be a power of two.
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] depth color depth of the pixmap
- * @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
+ * @param[in] depth color depth of the image.
+ * @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 PixmapImage* New(unsigned int width,
+ static NativeImageSource* New(unsigned int width,
unsigned int height,
- Dali::PixmapImage::ColorDepth depth,
- Any pixmap);
+ Dali::NativeImageSource::ColorDepth depth,
+ Any nativeImageSource);
/**
- * @copydoc Dali::PixmapImage::GetPixmap()
+ * @copydoc Dali::NativeImageSource::GetNativeImageSource()
*/
- Any GetPixmap() const;
+ Any GetNativeImageSource() const;
/**
- * @copydoc Dali::PixmapImage::GetPixels()
+ * @copydoc Dali::NativeImageSource::GetPixels()
*/
bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const;
/**
- * @copydoc Dali::PixmapImage::EncodeToFile(const std::string& )
+ * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
*/
bool EncodeToFile(const std::string& filename) const;
/**
* destructor
*/
- ~PixmapImage();
+ ~NativeImageSource();
/**
- * @copydoc Dali::PixmapImage::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::GlExtensionCreate()
*/
bool GlExtensionCreate();
/**
- * @copydoc Dali::PixmapImage::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
*/
void GlExtensionDestroy();
/**
- * @copydoc Dali::PixmapImage::TargetTexture()
+ * @copydoc Dali::NativeImageSource::TargetTexture()
*/
unsigned int TargetTexture();
/**
- * @copydoc Dali::PixmapImage::GetWidth()
+ * @copydoc Dali::NativeImageSource::GetWidth()
*/
unsigned int GetWidth() const
{
}
/**
- * @copydoc Dali::PixmapImage::GetHeight()
+ * @copydoc Dali::NativeImageSource::GetHeight()
*/
unsigned int GetHeight() const
{
}
/**
- * @copydoc Dali::PixmapImage::RequiresBlending()
+ * @copydoc Dali::NativeImageSource::RequiresBlending()
*/
bool RequiresBlending() const
{
private:
/**
- * Private constructor; @see PixmapImage::New()
+ * Private constructor; @see NativeImageSource::New()
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] colour depth of the pixmap
- * @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
+ * @param[in] colour depth of the image.
+ * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- PixmapImage(unsigned int width,
+ NativeImageSource(unsigned int width,
unsigned int height,
- Dali::PixmapImage::ColorDepth depth,
- Any pixmap);
+ Dali::NativeImageSource::ColorDepth depth,
+ Any nativeImageSource);
/**
* 2nd phase construction.
* Decide whether blending is required based on the color depth.
* @param depth the PixelImage depth enum
*/
- void SetBlending(Dali::PixmapImage::ColorDepth depth);
-
- /**
- * Given an existing pixmap, the function uses X to find out
- * the width, heigth and depth of that pixmap.
- */
- void GetPixmapDetails();
+ void SetBlending(Dali::NativeImageSource::ColorDepth depth);
private:
- unsigned int mWidth; ///< pixmap width
- unsigned int mHeight; ///< pixmap heights
+ unsigned int mWidth; ///< image width
+ unsigned int mHeight; ///< image heights
bool mOwnPixmap; ///< Whether we created pixmap or not
bool mBlendingRequired; ///< Whether blending is required
- Dali::PixmapImage::ColorDepth mColorDepth; ///< color depth of pixmap
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
void* mEglImageKHR; ///< From EGL extension
EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
};
} // namespace Dali
-#endif // __DALI_INTERNAL_PIXMAP_IMAGE_H__
+#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
$(adaptor_x11_dir)/clipboard-impl-x.cpp \
$(adaptor_x11_dir)/display-connection-impl-x.cpp \
$(adaptor_x11_dir)/imf-manager-impl-x.cpp \
- $(adaptor_x11_dir)/pixmap-image-impl-x.cpp \
+ $(adaptor_x11_dir)/native-image-source-impl-x.cpp \
$(adaptor_x11_dir)/virtual-keyboard-impl-x.cpp \
$(adaptor_x11_dir)/window-impl-x.cpp \
$(adaptor_x11_dir)/egl-implementation-x.cpp \
*/
// CLASS HEADER
-#include "pixmap-image-impl.h"
+#include "native-image-source-impl.h"
// EXTERNAL INCLUDES
#include <Ecore_X.h>
};
}
-PixmapImage* PixmapImage::New(unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Any pixmap )
+NativeImageSource* NativeImageSource::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
{
- PixmapImage* image = new PixmapImage( width, height, depth, pixmap );
- DALI_ASSERT_DEBUG( image && "PixmapImage allocation failed." );
+ NativeImageSource* image = new NativeImageSource( width, height, depth, nativeImageSource );
+ DALI_ASSERT_DEBUG( image && "NativeImageSource allocation failed." );
// 2nd phase construction
if(image) //< Defensive in case we ever compile without exceptions.
return image;
}
-PixmapImage::PixmapImage( unsigned int width, unsigned int height, Dali::PixmapImage::ColorDepth depth, Any pixmap )
+NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
: mWidth( width ),
mHeight( height ),
mOwnPixmap( true ),
DALI_ASSERT_DEBUG( mEglImageExtensions );
// assign the pixmap
- mPixmap = GetPixmapFromAny(pixmap);
+ mPixmap = GetPixmapFromAny(nativeImageSource);
}
-void PixmapImage::Initialize()
+void NativeImageSource::Initialize()
{
// if pixmap has been created outside of X11 Image we can return
if (mPixmap)
ecore_x_sync();
}
-PixmapImage::~PixmapImage()
+NativeImageSource::~NativeImageSource()
{
if (mOwnPixmap && mPixmap)
{
}
}
-Any PixmapImage::GetPixmap() const
+Any NativeImageSource::GetNativeImageSource() const
{
// return ecore x11 type
return Any(mPixmap);
}
-bool PixmapImage::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
{
DALI_ASSERT_DEBUG(sizeof(unsigned) == 4);
bool success = false;
}
if(!success)
{
- DALI_LOG_ERROR("Failed to get pixels from PixmapImage.");
+ DALI_LOG_ERROR("Failed to get pixels from NativeImageSource.");
pixbuf.resize(0);
width = 0;
height = 0;
return success;
}
-bool PixmapImage::EncodeToFile(const std::string& filename) const
+bool NativeImageSource::EncodeToFile(const std::string& filename) const
{
std::vector< unsigned char > pixbuf;
unsigned int width(0), height(0);
return false;
}
-bool PixmapImage::GlExtensionCreate()
+bool NativeImageSource::GlExtensionCreate()
{
// if the image existed previously delete it.
if (mEglImageKHR != NULL)
return mEglImageKHR != NULL;
}
-void PixmapImage::GlExtensionDestroy()
+void NativeImageSource::GlExtensionDestroy()
{
mEglImageExtensions->DestroyImageKHR(mEglImageKHR);
mEglImageKHR = NULL;
}
-unsigned int PixmapImage::TargetTexture()
+unsigned int NativeImageSource::TargetTexture()
{
mEglImageExtensions->TargetTextureKHR(mEglImageKHR);
return 0;
}
-int PixmapImage::GetPixelDepth(Dali::PixmapImage::ColorDepth depth) const
+int NativeImageSource::GetPixelDepth(Dali::NativeImageSource::ColorDepth depth) const
{
switch (depth)
{
- case Dali::PixmapImage::COLOR_DEPTH_DEFAULT:
+ case Dali::NativeImageSource::COLOR_DEPTH_DEFAULT:
{
// Get the default screen depth
return ecore_x_default_depth_get(ecore_x_display_get(), ecore_x_default_screen_get());
}
- case Dali::PixmapImage::COLOR_DEPTH_8:
+ case Dali::NativeImageSource::COLOR_DEPTH_8:
{
return 8;
}
- case Dali::PixmapImage::COLOR_DEPTH_16:
+ case Dali::NativeImageSource::COLOR_DEPTH_16:
{
return 16;
}
- case Dali::PixmapImage::COLOR_DEPTH_24:
+ case Dali::NativeImageSource::COLOR_DEPTH_24:
{
return 24;
}
- case Dali::PixmapImage::COLOR_DEPTH_32:
+ case Dali::NativeImageSource::COLOR_DEPTH_32:
{
return 32;
}
}
}
-Ecore_X_Pixmap PixmapImage::GetPixmapFromAny(Any pixmap) const
+Ecore_X_Pixmap NativeImageSource::GetPixmapFromAny(Any pixmap) const
{
if (pixmap.Empty())
{
}
}
-void PixmapImage::GetPixmapDetails()
+void NativeImageSource::GetPixmapDetails()
{
int x, y;
-#ifndef __DALI_INTERNAL_PIXMAP_IMAGE_H__
-#define __DALI_INTERNAL_PIXMAP_IMAGE_H__
+#ifndef __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
+#define __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
#include <Ecore_X.h>
// INTERNAL INCLUDES
-#include <pixmap-image.h>
+#include <native-image-source.h>
namespace Dali
{
class EglImageExtensions;
/**
- * Dali internal PixmapImage.
+ * Dali internal NativeImageSource.
*/
-class PixmapImage
+class NativeImageSource
{
public:
/**
- * Create a new PixmapImage internally.
+ * Create a new NativeImageSource internally.
* Depending on hardware the width and height may have to be a power of two.
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] depth color depth of the pixmap
- * @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
+ * @param[in] depth color depth of the image.
+ * @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 PixmapImage* New(unsigned int width,
+ static NativeImageSource* New(unsigned int width,
unsigned int height,
- Dali::PixmapImage::ColorDepth depth,
- Any pixmap);
+ Dali::NativeImageSource::ColorDepth depth,
+ Any nativeImageSource);
/**
- * @copydoc Dali::PixmapImage::GetPixmap()
+ * @copydoc Dali::NativeImageSource::GetNativeImageSource()
*/
- Any GetPixmap() const;
+ Any GetNativeImageSource() const;
/**
- * @copydoc Dali::PixmapImage::GetPixels()
+ * @copydoc Dali::NativeImageSource::GetPixels()
*/
bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const;
/**
- * @copydoc Dali::PixmapImage::EncodeToFile(const std::string& )
+ * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
*/
bool EncodeToFile(const std::string& filename) const;
/**
* destructor
*/
- ~PixmapImage();
+ ~NativeImageSource();
/**
- * @copydoc Dali::PixmapImage::GlExtensionCreate()
+ * @copydoc Dali::NativeImageSource::GlExtensionCreate()
*/
bool GlExtensionCreate();
/**
- * @copydoc Dali::PixmapImage::GlExtensionDestroy()
+ * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
*/
void GlExtensionDestroy();
/**
- * @copydoc Dali::PixmapImage::TargetTexture()
+ * @copydoc Dali::NativeImageSource::TargetTexture()
*/
unsigned int TargetTexture();
/**
- * @copydoc Dali::PixmapImage::GetWidth()
+ * @copydoc Dali::NativeImageSource::GetWidth()
*/
unsigned int GetWidth() const
{
}
/**
- * @copydoc Dali::PixmapImage::GetHeight()
+ * @copydoc Dali::NativeImageSource::GetHeight()
*/
unsigned int GetHeight() const
{
}
/**
- * @copydoc Dali::PixmapImage::RequiresBlending()
+ * @copydoc Dali::NativeImageSource::RequiresBlending()
*/
bool RequiresBlending() const
{
private:
/**
- * Private constructor; @see PixmapImage::New()
+ * Private constructor; @see NativeImageSource::New()
* @param[in] width The width of the image.
* @param[in] height The height of the image.
- * @param[in] colour depth of the pixmap
- * @param[in] pixmap contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
+ * @param[in] colour depth of the image.
+ * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
*/
- PixmapImage(unsigned int width,
+ NativeImageSource(unsigned int width,
unsigned int height,
- Dali::PixmapImage::ColorDepth depth,
- Any pixmap);
+ Dali::NativeImageSource::ColorDepth depth,
+ Any nativeImageSource);
/**
* 2nd phase construction.
* @param depth the PixelImage depth enum
* @return default x11 pixel depth
*/
- int GetPixelDepth(Dali::PixmapImage::ColorDepth depth) const;
+ int GetPixelDepth(Dali::NativeImageSource::ColorDepth depth) const;
/**
* Gets the pixmap from the Any parameter
private:
- unsigned int mWidth; ///< pixmap width
- unsigned int mHeight; ///< pixmap heights
+ unsigned int mWidth; ///< image width
+ unsigned int mHeight; ///< image heights
bool mOwnPixmap; ///< Whether we created pixmap or not
Ecore_X_Pixmap mPixmap; ///< From Xlib
bool mBlendingRequired; ///< Whether blending is required
- Dali::PixmapImage::ColorDepth mColorDepth; ///< color depth of pixmap
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
void* mEglImageKHR; ///< From EGL extension
EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
};
} // namespace Dali
-#endif // __DALI_INTERNAL_PIXMAP_IMAGE_H__
+#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
SET(CAPI_LIB "dali-adaptor")
SET(TC_SOURCES
utc-Dali-Key.cpp
- utc-Dali-PixmapImage.cpp
+ utc-Dali-NativeImageSource.cpp
utc-Dali-SingletonService.cpp
utc-Dali-Window.cpp
utc-Dali-Timer.cpp
using namespace Dali;
-void utc_dali_pixmap_image_startup(void)
+void utc_dali_native_image_source_startup(void)
{
test_return_value = TET_UNDEF;
}
-void utc_dali_pixmap_image_cleanup(void)
+void utc_dali_native_image_source_cleanup(void)
{
test_return_value = TET_PASS;
}
-int UtcDaliPixmapImageNewN(void)
+int UtcDaliNativeImageSourceNewN(void)
{
unsigned int width = 256u;
unsigned int heigth = 256u;
try
{
- PixmapImagePtr pixmapImage = PixmapImage::New(width, heigth, PixmapImage::COLOR_DEPTH_DEFAULT );
+ NativeImageSourcePtr nativeImageSource = NativeImageSource::New(width, heigth, NativeImageSource::COLOR_DEPTH_DEFAULT );
}
catch(Dali::DaliException& e)
{