From 65bb67c665fe465e388e8510eeb5fadda45cf202 Mon Sep 17 00:00:00 2001 From: Kimmo Hoikka Date: Tue, 30 Oct 2018 13:29:19 +0000 Subject: [PATCH] Remove TypeRegistration from deprecated Image classes No-one needs them so they just slow down each app startup unnecessarily Change-Id: I9d7e7c7dbbd35a1b4744b19603418cd5cb338ddc --- dali/internal/event/images/buffer-image-impl.cpp | 5 --- .../event/images/encoded-buffer-image-impl.cpp | 2 -- .../event/images/frame-buffer-image-impl.cpp | 2 -- dali/internal/event/images/image-impl.cpp | 32 ----------------- dali/internal/event/images/image-impl.h | 11 ------ dali/internal/event/images/native-image-impl.cpp | 5 --- .../event/images/nine-patch-image-impl.cpp | 5 --- dali/internal/event/images/resource-image-impl.cpp | 40 ---------------------- dali/internal/event/images/resource-image-impl.h | 11 ------ 9 files changed, 113 deletions(-) diff --git a/dali/internal/event/images/buffer-image-impl.cpp b/dali/internal/event/images/buffer-image-impl.cpp index 68c0027..c8a6988 100644 --- a/dali/internal/event/images/buffer-image-impl.cpp +++ b/dali/internal/event/images/buffer-image-impl.cpp @@ -34,11 +34,6 @@ namespace Dali namespace Internal { -namespace -{ -TypeRegistration mType( typeid( Dali::BufferImage ), typeid( Dali::Image ), NULL ); -} // unnamed namespace - BufferImagePtr BufferImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat ) diff --git a/dali/internal/event/images/encoded-buffer-image-impl.cpp b/dali/internal/event/images/encoded-buffer-image-impl.cpp index d6d5de0..255709a 100644 --- a/dali/internal/event/images/encoded-buffer-image-impl.cpp +++ b/dali/internal/event/images/encoded-buffer-image-impl.cpp @@ -35,8 +35,6 @@ namespace Internal namespace { -TypeRegistration mType( typeid( Dali::EncodedBufferImage ), typeid( Dali::Image ), NULL ); - /** Raw bytes of a resource laid out exactly as it would be in a file, but in memory. */ typedef Dali::RefCountedVector RequestBuffer; /** Counting smart pointer for managing a buffer of raw bytes. */ diff --git a/dali/internal/event/images/frame-buffer-image-impl.cpp b/dali/internal/event/images/frame-buffer-image-impl.cpp index 15aa6a8..def730a 100644 --- a/dali/internal/event/images/frame-buffer-image-impl.cpp +++ b/dali/internal/event/images/frame-buffer-image-impl.cpp @@ -30,8 +30,6 @@ namespace Internal namespace { -TypeRegistration mType( typeid( Dali::FrameBufferImage ), typeid( Dali::Image ), NULL ); - const int RenderBufferFormatToFrameBufferAttachments[] = { Dali::FrameBuffer::Attachment::NONE, Dali::FrameBuffer::Attachment::DEPTH, Dali::FrameBuffer::Attachment::STENCIL, diff --git a/dali/internal/event/images/image-impl.cpp b/dali/internal/event/images/image-impl.cpp index 8357fcf..49d7f54 100644 --- a/dali/internal/event/images/image-impl.cpp +++ b/dali/internal/event/images/image-impl.cpp @@ -37,38 +37,6 @@ namespace Dali namespace Internal { -namespace -{ - -// Signals - -const char* const SIGNAL_IMAGE_UPLOADED = "uploaded"; - -TypeRegistration mType( typeid( Dali::Image ), typeid( Dali::BaseHandle ), NULL ); - -Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_UPLOADED, &Image::DoConnectSignal ); - -} - -bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - bool connected( true ); - DALI_ASSERT_DEBUG( dynamic_cast( object ) && "Failed to downcast from BaseObject to Image.\n" ); - Image* image = static_cast(object); - - if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_UPLOADED ) ) - { - image->UploadedSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - - return connected; -} - unsigned int Image::GetWidth() const { return mWidth; diff --git a/dali/internal/event/images/image-impl.h b/dali/internal/event/images/image-impl.h index 2a4f142..de6df50 100644 --- a/dali/internal/event/images/image-impl.h +++ b/dali/internal/event/images/image-impl.h @@ -51,17 +51,6 @@ public: Dali::Image::ImageSignalType& UploadedSignal() { return mUploaded; } /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - - /** * Get the width of the image. * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) diff --git a/dali/internal/event/images/native-image-impl.cpp b/dali/internal/event/images/native-image-impl.cpp index d7e3f9e..39c8ecb 100644 --- a/dali/internal/event/images/native-image-impl.cpp +++ b/dali/internal/event/images/native-image-impl.cpp @@ -33,11 +33,6 @@ namespace Dali namespace Internal { -namespace -{ -TypeRegistration mType( typeid(Dali::NativeImage), typeid(Dali::Image), NULL ); -} - NativeImage::NativeImage( NativeImageInterface& resourceData ) : Image() { diff --git a/dali/internal/event/images/nine-patch-image-impl.cpp b/dali/internal/event/images/nine-patch-image-impl.cpp index 7662edc..ca96236 100644 --- a/dali/internal/event/images/nine-patch-image-impl.cpp +++ b/dali/internal/event/images/nine-patch-image-impl.cpp @@ -167,11 +167,6 @@ namespace Dali namespace Internal { -namespace -{ -TypeRegistration mType( typeid( Dali::NinePatchImage ), typeid( Dali::Image ), NULL ); -} // unnamed namespace - NinePatchImagePtr NinePatchImage::New( const std::string& filename ) { Internal::NinePatchImagePtr internal( new NinePatchImage( filename ) ); diff --git a/dali/internal/event/images/resource-image-impl.cpp b/dali/internal/event/images/resource-image-impl.cpp index 0b0417f..9269e15 100644 --- a/dali/internal/event/images/resource-image-impl.cpp +++ b/dali/internal/event/images/resource-image-impl.cpp @@ -38,26 +38,6 @@ namespace Dali namespace Internal { -namespace -{ - -// Signals - -const char* const SIGNAL_IMAGE_LOADING_FINISHED = "imageLoadingFinished"; - - -BaseHandle CreateImage() -{ - ImagePtr image = ResourceImage::New(); - return Dali::Image(image.Get()); -} - -TypeRegistration mType( typeid( Dali::ResourceImage ), typeid( Dali::Image ), CreateImage ); - -Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_LOADING_FINISHED, &ResourceImage::DoConnectSignal ); - -} - ResourceImage::ResourceImage() : Image(), mLoadingFinished(), @@ -107,26 +87,6 @@ ResourceImage::~ResourceImage() { } -bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) -{ - bool connected( true ); - DALI_ASSERT_DEBUG( dynamic_cast( object ) && "Failed to downcast from BaseObject to ResourceImage.\n" ); - ResourceImage* image = static_cast(object); - - if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED ) ) - { - image->LoadingFinishedSignal().Connect( tracker, functor ); - } - else - { - // signalName does not match any signal - connected = false; - } - - return connected; -} - - const ImageAttributes& ResourceImage::GetAttributes() const { return mAttributes; diff --git a/dali/internal/event/images/resource-image-impl.h b/dali/internal/event/images/resource-image-impl.h index 5843fd8..ce1d227 100644 --- a/dali/internal/event/images/resource-image-impl.h +++ b/dali/internal/event/images/resource-image-impl.h @@ -71,17 +71,6 @@ public: Dali::ResourceImage::ResourceImageSignal& LoadingFinishedSignal() { return mLoadingFinished; } /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - - /** * Get the attributes of the image. * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) -- 2.7.4