#include <dali/integration-api/profiling.h>
// INTERNAL INCLUDES
+#include <dali/integration-api/bitmap.h>
+
#include <dali/internal/event/common/thread-local-storage.h>
#include <dali/internal/event/events/gesture-event-processor.h>
+#include <dali/internal/event/actors/actor-impl.h>
+#include <dali/internal/event/actors/camera-actor-impl.h>
+#include <dali/internal/event/actors/text-actor-impl.h>
+#include <dali/internal/event/actors/image-actor-impl.h>
+#include <dali/internal/event/actors/mesh-actor-impl.h>
+#include <dali/internal/event/actors/layer-impl.h>
+
+#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
+#include <dali/internal/event/actor-attachments/camera-attachment-impl.h>
+#include <dali/internal/event/actor-attachments/text-attachment-impl.h>
+#include <dali/internal/event/actor-attachments/image-attachment-impl.h>
+#include <dali/internal/event/actor-attachments/mesh-attachment-impl.h>
+
+#include <dali/internal/event/animation/animation-impl.h>
+#include <dali/internal/event/animation/animator-connector.h>
+#include <dali/internal/event/animation/constraint-impl.h>
+#include <dali/internal/event/animation/active-constraint-impl.h>
+#include <dali/internal/update/animation/property-accessor.h>
+#include <dali/internal/update/animation/scene-graph-animation.h>
+#include <dali/internal/update/animation/scene-graph-constraint.h>
+
+
+#include <dali/internal/event/images/image-impl.h>
+#include <dali/internal/event/images/image-factory-cache.h>
+#include <dali/internal/common/text-parameters.h>
+#include <dali/internal/event/modeling/mesh-impl.h>
+#include <dali/internal/event/modeling/material-impl.h>
+
+#include <dali/internal/event/resources/resource-ticket.h>
+#include <dali/internal/event/resources/image-ticket.h>
+
+#include <dali/internal/update/nodes/node.h>
+#include <dali/internal/update/nodes/scene-graph-layer.h>
+#include <dali/internal/update/modeling/internal-mesh-data.h>
+#include <dali/internal/update/modeling/scene-graph-animatable-mesh.h>
+#include <dali/internal/update/modeling/scene-graph-material.h>
+#include <dali/internal/update/modeling/scene-graph-mesh.h>
+
+#include <dali/internal/update/node-attachments/node-attachment.h>
+#include <dali/internal/update/node-attachments/scene-graph-camera-attachment.h>
+#include <dali/internal/update/node-attachments/scene-graph-image-attachment.h>
+#include <dali/internal/update/node-attachments/scene-graph-mesh-attachment.h>
+#include <dali/internal/update/node-attachments/scene-graph-text-attachment.h>
+
+#include <dali/internal/update/resources/bitmap-metadata.h>
+
+#include <dali/internal/render/gl-resources/bitmap-texture.h>
+
+#include <dali/internal/render/renderers/render-material.h>
+#include <dali/internal/render/renderers/scene-graph-image-renderer.h>
+#include <dali/internal/render/renderers/scene-graph-text-renderer.h>
+#include <dali/internal/render/renderers/scene-graph-mesh-renderer.h>
+
using Dali::Internal::GestureEventProcessor;
using Dali::Internal::ThreadLocalStorage;
eventProcessor.SetPanGesturePredictionMode(mode);
}
+namespace Profiling
+{
+
+const int ANIMATION_MEMORY_SIZE(
+ sizeof( Internal::Animation ) +
+ sizeof( Internal::AnimatorConnector<float> ) +
+ sizeof( Internal::SceneGraph::Animation ) );
+const int CONSTRAINT_MEMORY_SIZE(
+ sizeof( Internal::Constraint ) +
+ sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) +
+ sizeof( Internal::ActiveConstraint<float> ) );
+const int ACTOR_MEMORY_SIZE(
+ sizeof( Internal::Actor ) +
+ sizeof( Internal::ActorAttachment ) +
+ sizeof( Internal::SceneGraph::Node ) +
+ sizeof( Internal::SceneGraph::NodeAttachment ));
+const int CAMERA_ACTOR_MEMORY_SIZE(
+ sizeof( Internal::CameraActor ) +
+ sizeof( Internal::CameraAttachment ) +
+ sizeof( Internal::SceneGraph::Node ) +
+ sizeof( Internal::SceneGraph::CameraAttachment ) );
+const int TEXT_ACTOR_MEMORY_SIZE(
+ sizeof( Internal::TextActor ) +
+ sizeof( Internal::TextAttachment ) +
+ sizeof( Internal::SceneGraph::Node ) +
+ sizeof( Internal::SceneGraph::TextAttachment ) +
+ sizeof( Internal::TextParameters ) +
+ sizeof( Internal::SceneGraph::TextRenderer ) );
+const int MESH_ACTOR_MEMORY_SIZE(
+ sizeof( Internal::MeshActor ) +
+ sizeof( Internal::MeshAttachment ) +
+ sizeof( Internal::SceneGraph::Node ) +
+ sizeof( Internal::SceneGraph::MeshAttachment ) +
+ sizeof( Internal::SceneGraph::MeshRenderer ) );
+const int IMAGE_ACTOR_MEMORY_SIZE(
+ sizeof( Internal::ImageActor ) +
+ sizeof( Internal::ImageAttachment ) +
+ sizeof( Internal::SceneGraph::Node ) +
+ sizeof( Internal::SceneGraph::ImageAttachment ) +
+ sizeof( Internal::SceneGraph::ImageRenderer ));
+const int LAYER_MEMORY_SIZE(
+ sizeof( Internal::Layer ) +
+ sizeof( Internal::ActorAttachment ) +
+ sizeof( Internal::SceneGraph::Layer ) +
+ sizeof( Internal::SceneGraph::NodeAttachment ) );
+const int IMAGE_MEMORY_SIZE(
+ sizeof( Internal::Image ) +
+ sizeof( Internal::ImageFactoryCache::Request ) +
+ sizeof( Integration::Bitmap ) +
+ sizeof( Internal::BitmapMetadata ) +
+ sizeof( Internal::BitmapTexture ) +
+ sizeof( Internal::ImageTicket ) );
+const int MESH_MEMORY_SIZE(
+ sizeof( Internal::Mesh ) +
+ sizeof( Internal::MeshData ) +
+ sizeof( Internal::SceneGraph::Mesh ) +
+ sizeof( Internal::ResourceTicket ) );
+const int MATERIAL_MEMORY_SIZE(
+ sizeof( Internal::Material ) +
+ sizeof( Internal::SceneGraph::Material ) +
+ sizeof( Internal::SceneGraph::RenderMaterial ) );
+
+} // namespace Profiling
+
} // namespace Integration
} // namespace Dali
*/
DALI_IMPORT_API void SetPanGesturePredictionMode( int mode );
+
+namespace Profiling
+{
+
+DALI_IMPORT_API extern const int ANIMATION_MEMORY_SIZE; ///< Total size of animation and associated internal objects
+DALI_IMPORT_API extern const int CONSTRAINT_MEMORY_SIZE; ///< Total size of constraint and associated internal objects
+DALI_IMPORT_API extern const int ACTOR_MEMORY_SIZE; ///< Total size of actor and associated internal objects
+DALI_IMPORT_API extern const int CAMERA_ACTOR_MEMORY_SIZE; ///< Total size of camera actor and associated internal objects
+DALI_IMPORT_API extern const int TEXT_ACTOR_MEMORY_SIZE; ///< Total size of text actor and associated internal objects
+DALI_IMPORT_API extern const int MESH_ACTOR_MEMORY_SIZE; ///< Total size of mesh actor and associated internal objects
+DALI_IMPORT_API extern const int IMAGE_ACTOR_MEMORY_SIZE; ///< Total size of image actor and associated internal objects
+DALI_IMPORT_API extern const int LAYER_MEMORY_SIZE; ///< Total size of layer and associated internal objects
+DALI_IMPORT_API extern const int IMAGE_MEMORY_SIZE; ///< Total size of image and associated internal objects
+DALI_IMPORT_API extern const int MESH_MEMORY_SIZE; ///< Total size of mesh and associated internal objects
+DALI_IMPORT_API extern const int MATERIAL_MEMORY_SIZE; ///< Total size of material and associated internal objects
+} // namespace Profiling
+
} // namespace Integration
} // namespace Dali
// CLASS HEADER
#include <dali/internal/event/actors/camera-actor-impl.h>
+// EXTERNAL INCLUDES
+#include <cmath>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/actors/layer.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/actors/actor-declarations.h>
-#include <dali/internal/event/images/frame-buffer-image-impl.h>
namespace Dali
{
*/
void OnInitialize();
- /**
+ /**
* Query the current depth of the layer
*/
unsigned int GetDepth() const;
LayerList* mLayerList; ///< Only valid when layer is on-stage
// These properties not animatable; the actor side has the most up-to-date values
- FrameBufferImagePtr mFrameBufferImage; ///< Ticket for offscreen render target
ClippingBox mClippingBox; ///< The clipping box, in window coordinates
Dali::Layer::SortFunctionType mSortFunction; ///< Used to sort semi-transparent geometry
static ObjectRegistryPtr New();
/**
- * Registers the Object into the Object Registry, Which notifies
- * about this object creation to its observers.
+ * Registers the Object into the Object Registry, which notifies
+ * about this object creation to its observers using signals. As
+ * the signals use a BaseHandle, the object must already have a
+ * ref-count > 0, otherwise it will get deleted on signal completion.
* @pre The object is not already registered.
+ * @pre the object is ref counted (held in an intrusive pointer)
* @param[in] object Pointer to the object.
*/
void RegisterObject( Dali::BaseObject* object );
#include <dali/internal/event/common/system-overlay-impl.h>
#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/event/common/projection.h>
+#include <dali/internal/event/images/frame-buffer-image-impl.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/internal/event/render-tasks/render-task-list-impl.h>
namespace Internal
{
-BitmapImage* BitmapImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat, LoadPolicy loadPol, ReleasePolicy releasePol )
+BitmapImagePtr BitmapImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat, LoadPolicy loadPol, ReleasePolicy releasePol )
{
- BitmapImage* internal = new BitmapImage( width, height, pixelformat, loadPol, releasePol );
+ BitmapImagePtr internal = new BitmapImage( width, height, pixelformat, loadPol, releasePol );
internal->Initialize();
return internal;
}
-BitmapImage* BitmapImage::New( PixelBuffer* pixBuf, unsigned int width, unsigned int height, Pixel::Format pixelformat, unsigned int stride, ReleasePolicy releasePol )
+BitmapImagePtr BitmapImage::New( PixelBuffer* pixBuf, unsigned int width, unsigned int height, Pixel::Format pixelformat, unsigned int stride, ReleasePolicy releasePol )
{
- BitmapImage* internal = new BitmapImage( pixBuf, width, height, pixelformat, stride, releasePol );
+ BitmapImagePtr internal = new BitmapImage( pixBuf, width, height, pixelformat, stride, releasePol );
internal->Initialize();
return internal;
}
: Image(loadPol, releasePol),
mIsDataExternal(false)
{
- Initialize();
-
+ ThreadLocalStorage& tls = ThreadLocalStorage::Get();
+ mResourceClient = &tls.GetResourceClient();
mWidth = width;
mHeight = height;
: Image(ImageLoadPolicyDefault, releasePol),
mIsDataExternal(true)
{
- Initialize();
+ ThreadLocalStorage& tls = ThreadLocalStorage::Get();
+ mResourceClient = &tls.GetResourceClient();
mWidth = width;
mHeight = height;
Integration::Bitmap* bitmap = new BitmapExternal(pixBuf, width, height, pixelformat, stride);
return bufferStride;
}
-void BitmapImage::Initialize()
-{
- ThreadLocalStorage& tls = ThreadLocalStorage::Get();
- mResourceClient = &tls.GetResourceClient();
-}
-
void BitmapImage::Connect()
{
++mConnectionCount;
* @param [in] loadPol controls time of loading a resource from the filesystem (default: load when Image is created).
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
*/
- static BitmapImage* New( unsigned int width,
- unsigned int height,
- Pixel::Format pixelformat,
- LoadPolicy loadPol=ImageLoadPolicyDefault,
- ReleasePolicy releasePol=ImageReleasePolicyDefault);
+ static BitmapImagePtr New( unsigned int width,
+ unsigned int height,
+ Pixel::Format pixelformat,
+ LoadPolicy loadPol=ImageLoadPolicyDefault,
+ ReleasePolicy releasePol=ImageReleasePolicyDefault);
/**
* Create a new BitmapImage, which uses external data source.
* @param [in] stride the internal stride of the pixelbuffer in pixels
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
*/
- static BitmapImage* New( PixelBuffer* pixBuf,
- unsigned int width,
- unsigned int height,
- Pixel::Format pixelformat,
- unsigned int stride,
- ReleasePolicy releasePol=ImageReleasePolicyDefault );
+ static BitmapImagePtr New( PixelBuffer* pixBuf,
+ unsigned int width,
+ unsigned int height,
+ Pixel::Format pixelformat,
+ unsigned int stride,
+ ReleasePolicy releasePol=ImageReleasePolicyDefault );
/**
* Create a new BitmapImage.
*/
unsigned int GetBufferStride() const;
-private:
-
- /**
- * Initializes internal data.
- */
- void Initialize();
-
protected: // From Resource
/**
* @copydoc Dali::Internal::Image::Connect
namespace Internal
{
-Dali::EncodedBufferImage EncodedBufferImage::New( const uint8_t * const encodedImage,
- const std::size_t encodedImageByteCount,
- const ImageAttributes& attributes,
- const ReleasePolicy releasePol )
+EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImage,
+ const std::size_t encodedImageByteCount,
+ const ImageAttributes& attributes,
+ const ReleasePolicy releasePol )
{
DALI_ASSERT_DEBUG( encodedImage && "Null image pointer passed-in for decoding from memory." );
DALI_ASSERT_DEBUG( encodedImageByteCount > 0U && "Zero size passed for image resource in memory buffer." );
// input buffer by reading both ends of it:
DALI_ASSERT_ALWAYS( static_cast<int>( encodedImage[0] + encodedImage[encodedImageByteCount-1] ) != -1 );
- EncodedBufferImage* const image = new EncodedBufferImage( releasePol );
- // Make sure that this image object cannot leak if we throw:
- Dali::EncodedBufferImage publicImage(image);
+ EncodedBufferImagePtr image( new EncodedBufferImage( releasePol ) );
+ image->Initialize(); // Second stage initialization
// Replicate the functionality of ImageFactory::load() without the filesystem caching:
Dali::Integration::BitmapResourceType resourceType( attributes );
imageTicket->AddObserver( *image );
}
- return publicImage;
+ return image;
}
} // namespace Internal
* be recreated by dali, the default of Never will usually make sense.
* @return A pointer to a newly allocated object, or null on error.
*/
- static Dali::EncodedBufferImage New(const uint8_t * const encodedImage,
- const std::size_t encodedImageByteCount,
- const ImageAttributes& attributes,
- const ReleasePolicy releasePol=Dali::Image::Never);
+ static EncodedBufferImagePtr New(const uint8_t * const encodedImage,
+ const std::size_t encodedImageByteCount,
+ const ImageAttributes& attributes,
+ const ReleasePolicy releasePol=Dali::Image::Never);
};
} // namespace Internal
{
}
+FrameBufferImagePtr FrameBufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleasePolicy releasePolicy)
+{
+ FrameBufferImagePtr image = new FrameBufferImage(width, height, pixelFormat, releasePolicy);
+ image->Initialize();
+ return image;
+}
+
+FrameBufferImagePtr FrameBufferImage::New( NativeImage& nativeImage )
+{
+ FrameBufferImagePtr image = new FrameBufferImage(nativeImage);
+ image->Initialize();
+ return image;
+}
+
+FrameBufferImagePtr FrameBufferImage::New( NativeImage& nativeImage, ReleasePolicy releasePolicy )
+{
+ FrameBufferImagePtr image = new FrameBufferImage(nativeImage, releasePolicy);
+ image->Initialize();
+ return image;
+}
+
FrameBufferImage::FrameBufferImage(unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleasePolicy releasePolicy)
: Image(Dali::Image::Immediate, releasePolicy),
mPixelFormat(pixelFormat)
mHeight = height;
}
+
FrameBufferImage::FrameBufferImage( NativeImage& nativeImage )
: Image(Dali::Image::Immediate),
mNativeImage(&nativeImage),
mHeight = nativeImage.GetHeight();
}
+
FrameBufferImage::FrameBufferImage( NativeImage& nativeImage, ReleasePolicy releasePolicy )
: Image(Dali::Image::Immediate, releasePolicy),
mNativeImage(&nativeImage),
class FrameBufferImage : public Image
{
public:
- /// @copydoc Dali::FrameBufferImage::FrameBufferImage
+ /**
+ * @copydoc Dali::FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format)
+ */
+ static FrameBufferImagePtr New(unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleasePolicy releasePolicy);
+
+ /**
+ * @copydoc Dali::FrameBufferImage::New(NativeImage&)
+ */
+ static FrameBufferImagePtr New( NativeImage& nativeImage );
+
+ /**
+ * @copydoc Dali::FrameBufferImage::New(NativeImage&, ReleasePolicy)
+ */
+ static FrameBufferImagePtr New( NativeImage& nativeImage, ReleasePolicy releasePolicy );
+
+ /**
+ * @copydoc Dali::FrameBufferImage::FrameBufferImage
+ */
FrameBufferImage(unsigned int width, unsigned int height, Pixel::Format pixelFormat);
- /// @copydoc Dali::FrameBufferImage::FrameBufferImage
+ /**
+ * @copydoc Dali::FrameBufferImage::FrameBufferImage
+ */
FrameBufferImage(unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleasePolicy releasePolicy);
- /// @copydoc Dali::FrameBufferImage::FrameBufferImage
+ /**
+ * @copydoc Dali::FrameBufferImage::FrameBufferImage
+ */
FrameBufferImage(NativeImage& image);
- /// @copydoc Dali::FrameBufferImage::FrameBufferImage
+ /**
+ * @copydoc Dali::FrameBufferImage::FrameBufferImage
+ */
FrameBufferImage(NativeImage& image, ReleasePolicy releasePolicy);
public: // From Image
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/integration-api/debug.h>
namespace Internal
{
+namespace
+{
+
+BaseHandle CreateImage()
+{
+ ImagePtr image = Image::New();
+ return Dali::Image(image.Get());
+}
+
+TypeRegistration mType( typeid(Dali::Image), typeid(Dali::BaseHandle), CreateImage );
+
+Dali::SignalConnectorType signalConnector1(mType, Dali::Image::SIGNAL_IMAGE_LOADING_FINISHED, &Image::DoConnectSignal);
+Dali::SignalConnectorType signalConnector2(mType, Dali::Image::SIGNAL_IMAGE_UPLOADED, &Image::DoConnectSignal);
+}
+
Image::Image( LoadPolicy loadPol, ReleasePolicy releasePol )
: mWidth(0),
mHeight(0),
{
}
-Image* Image::New()
+ImagePtr Image::New()
{
- return new Image;
+ ImagePtr image = new Image;
+ image->Initialize();
+ return image;
}
-Image* Image::New( const std::string& filename, const Dali::ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol )
+ImagePtr Image::New( const std::string& filename, const Dali::ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol )
{
if( IsNinePatchFileName(filename) )
{
- NinePatchImage* image = new NinePatchImage( filename, attributes, loadPol, releasePol );
+ NinePatchImagePtr image = NinePatchImage::New( filename, attributes, loadPol, releasePol );
return image;
}
else
{
- Image* image = new Image( loadPol, releasePol );
+ ImagePtr image = new Image( loadPol, releasePol );
+ image->Initialize();
if( ! filename.empty() )
{
image->mTicket = image->mImageFactory.Load( image->mRequest.Get() );
image->mTicket->AddObserver( *image );
}
+
// else lazily load image data later, only when it is needed to draw something:
DALI_LOG_SET_OBJECT_STRING( image, filename );
}
}
-Image* Image::New( NativeImage& nativeImg, LoadPolicy loadPol, ReleasePolicy releasePol )
+ImagePtr Image::New( NativeImage& nativeImg, LoadPolicy loadPol, ReleasePolicy releasePol )
{
- Image* image = new Image;
- ResourceClient &resourceClient = ThreadLocalStorage::Get().GetResourceClient();
+ ImagePtr image = new Image;
+ image->Initialize();
+ ResourceClient &resourceClient = ThreadLocalStorage::Get().GetResourceClient();
image->mWidth = nativeImg.GetWidth();
image->mHeight = nativeImg.GetHeight();
mImageFactory.ReleaseTicket( mTicket.Get() );
}
}
+
+ if( Stage::IsInstalled() )
+ {
+ UnregisterObject();
+ }
}
bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
}
}
+void Image::Initialize()
+{
+ RegisterObject();
+}
+
void Image::SetTicket( ResourceTicket* ticket )
{
if( ticket == mTicket.Get() )
virtual ~Image();
/**
- * Constructor
+ * Constructor, with default parameters
*/
Image(LoadPolicy loadPol=ImageLoadPolicyDefault, ReleasePolicy releasePol=ImageReleasePolicyDefault);
* Creates a pointer to an uninitialized Image object.
* @return a pointer to a newly created object.
*/
- static Image* New();
+ static ImagePtr New();
/**
* Creates object and loads image from filesystem
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
* @return a pointer to a newly created object.
*/
- static Image* New(const std::string& filename,
- const Dali::ImageAttributes& attributes=Dali::ImageAttributes::DEFAULT_ATTRIBUTES,
- LoadPolicy loadPol=ImageLoadPolicyDefault,
- ReleasePolicy releasePol=ImageReleasePolicyDefault);
-
-
-
-public:
+ static ImagePtr New( const std::string& filename,
+ const Dali::ImageAttributes& attributes=Dali::ImageAttributes::DEFAULT_ATTRIBUTES,
+ LoadPolicy loadPol=ImageLoadPolicyDefault,
+ ReleasePolicy releasePol=ImageReleasePolicyDefault );
/**
* Creates object with already loaded NativeImage
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
* @return a pointer to a newly created object.
*/
- static Image* New(NativeImage& nativeImg,
- LoadPolicy loadPol=ImageLoadPolicyDefault,
- ReleasePolicy releasePol=ImageReleasePolicyDefault);
+ static ImagePtr New( NativeImage& nativeImg,
+ LoadPolicy loadPol=ImageLoadPolicyDefault,
+ ReleasePolicy releasePol=ImageReleasePolicyDefault );
/**
* @copydoc Dali::Image::GetLoadingState()
*/
virtual void Disconnect();
+protected:
+ /**
+ * Second stage initialization
+ */
+ void Initialize();
+
private:
/**
: Image(Dali::Image::Immediate, Dali::Image::Never),
mParsedBorder(false)
{
- Initialize();
+ ThreadLocalStorage& tls = ThreadLocalStorage::Get();
+ mResourceClient = &tls.GetResourceClient();
Integration::PlatformAbstraction& platformAbstraction = Internal::ThreadLocalStorage::Get().GetPlatformAbstraction();
return cropped;
}
-void NinePatchImage::Initialize()
-{
- ThreadLocalStorage& tls = ThreadLocalStorage::Get();
- mResourceClient = &tls.GetResourceClient();
-}
-
void NinePatchImage::Connect()
{
if( mConnectionCount == 0 && !mTicket )
*/
BitmapImagePtr CreateCroppedBitmapImage();
-private:
- /**
- * Initializes internal data.
- */
- void Initialize();
protected: // From Resource
/**
EncodedBufferImage EncodedBufferImage::New(const uint8_t * const encodedImage, const std::size_t encodedImageByteCount, const ImageAttributes& attributes, const ReleasePolicy releasePol)
{
- EncodedBufferImage image = Internal::EncodedBufferImage::New(encodedImage, encodedImageByteCount, attributes, releasePol);
+ Internal::EncodedBufferImagePtr internal=Internal::EncodedBufferImage::New(encodedImage, encodedImageByteCount, attributes, releasePol);
+ EncodedBufferImage image(internal.Get());
return image;
}
EncodedBufferImage EncodedBufferImage::New(const uint8_t * const encodedImage, const std::size_t encodedImageByteCount)
{
ImageAttributes attributes;
- EncodedBufferImage image = Internal::EncodedBufferImage::New(encodedImage, encodedImageByteCount, attributes, Dali::Image::Never);
+ Internal::EncodedBufferImagePtr internal = Internal::EncodedBufferImage::New(encodedImage, encodedImageByteCount, attributes, Dali::Image::Never);
+ EncodedBufferImage image( internal.Get() );
return image;
}
FrameBufferImage FrameBufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelformat)
{
Dali::Vector2 stageSize = Stage::GetCurrent().GetSize();
- return FrameBufferImage(new Internal::FrameBufferImage((0 == width) ? stageSize.width : width,
- (0 == height) ? stageSize.height : height,
- pixelformat,
- Dali::Image::Never));
+ Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New(
+ (0 == width) ? stageSize.width : width,
+ (0 == height) ? stageSize.height : height,
+ pixelformat,
+ Dali::Image::Never);
+
+ return FrameBufferImage(internal.Get());
}
FrameBufferImage FrameBufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelformat, ReleasePolicy releasePolicy)
{
Dali::Vector2 stageSize = Stage::GetCurrent().GetSize();
- return FrameBufferImage(new Internal::FrameBufferImage((0 == width) ? stageSize.width : width,
- (0 == height) ? stageSize.height : height,
- pixelformat,
- releasePolicy));
+ Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New(
+ (0 == width) ? stageSize.width : width,
+ (0 == height) ? stageSize.height : height,
+ pixelformat,
+ releasePolicy);
+
+ return FrameBufferImage(internal.Get());
}
FrameBufferImage FrameBufferImage::New( NativeImage& image, ReleasePolicy releasePolicy )
{
- return FrameBufferImage(new Internal::FrameBufferImage( image, releasePolicy ));
+ Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New( image, releasePolicy );
+ return FrameBufferImage(internal.Get());
}
FrameBufferImage FrameBufferImage::New( NativeImage& image )
{
- return FrameBufferImage(new Internal::FrameBufferImage( image ));
+ Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New( image );
+ return FrameBufferImage(internal.Get());
}
FrameBufferImage FrameBufferImage::DownCast( BaseHandle handle )
Image Image::New(const std::string& filename)
{
- Internal::Image* internal = Internal::Image::New(filename);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename);
+ return Image(internal.Get());
}
Image Image::New(const std::string& filename, LoadPolicy loadPol, ReleasePolicy releasePol)
{
- Internal::Image* internal = Internal::Image::New(filename,
- Dali::ImageAttributes::DEFAULT_ATTRIBUTES,
- loadPol, releasePol);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename,
+ Dali::ImageAttributes::DEFAULT_ATTRIBUTES,
+ loadPol, releasePol);
+ return Image(internal.Get());
}
Image Image::New(const std::string& filename, const ImageAttributes& attributes)
{
- Internal::Image* internal = Internal::Image::New(filename, attributes);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes);
+ return Image(internal.Get());
}
Image Image::New(const std::string& filename, const ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol)
{
- Internal::Image* internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
+ return Image(internal.Get());
}
Image Image::NewDistanceField(const std::string& filename)
{
ImageAttributes attributes = ImageAttributes::NewDistanceField();
- Internal::Image* internal = Internal::Image::New(filename, attributes);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes);
+ return Image(internal.Get());
}
Image Image::NewDistanceField(const std::string& filename, LoadPolicy loadPol, ReleasePolicy releasePol)
{
ImageAttributes attributes = ImageAttributes::NewDistanceField();
- Internal::Image* internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
+ return Image(internal.Get());
}
Image Image::NewDistanceField(const std::string& filename, const ImageAttributes& attributes)
{
DALI_ASSERT_DEBUG(attributes.IsDistanceField());
- Internal::Image* internal = Internal::Image::New(filename, attributes);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes);
+ return Image(internal.Get());
}
Image Image::NewDistanceField(const std::string& filename, const ImageAttributes& attributes, LoadPolicy loadPol, ReleasePolicy releasePol)
{
DALI_ASSERT_DEBUG(attributes.IsDistanceField());
- Internal::Image* internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(filename, attributes, loadPol, releasePol);
+ return Image(internal.Get());
}
Image Image::New(NativeImage& nativeImg)
{
- Internal::Image* internal = Internal::Image::New(nativeImg);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(nativeImg);
+ return Image(internal.Get());
}
Image Image::New(NativeImage& nativeImg, LoadPolicy loadPol, ReleasePolicy releasePol)
{
- Internal::Image* internal = Internal::Image::New(nativeImg, loadPol, releasePol);
- return Image(internal);
+ Internal::ImagePtr internal = Internal::Image::New(nativeImg, loadPol, releasePol);
+ return Image(internal.Get());
}
Image Image::DownCast( BaseHandle handle )