/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
+ DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Failed to downcast from BaseObject to ResourceImage.\n" );
ResourceImage* image = static_cast<ResourceImage*>(object);
if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED ) )
mAttributes.GetOrientationCorrection() );
// Note, bitmap is only destroyed when the image is destroyed.
- Integration::ResourcePointer resource = platformAbstraction.LoadResourceSynchronously( resourceType, mUrl );
+ Integration::ResourcePointer resource = platformAbstraction.LoadImageSynchronously( resourceType, mUrl );
if( resource )
{
Integration::Bitmap* bitmap = static_cast<Integration::Bitmap*>( resource.Get() );
//Create texture
Pixel::Format format = bitmap->GetPixelFormat();
- mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
+ mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
//Upload data to the texture
- size_t bufferSize = bitmap->GetBufferSize();
+ uint32_t bufferSize = bitmap->GetBufferSize();
PixelDataPtr pixelData = PixelData::New( bitmap->GetBufferOwnership(), bufferSize, width, height, format,
static_cast< Dali::PixelData::ReleaseFunction >( bitmap->GetReleaseFunction() ) );
mTexture->Upload( pixelData );
}
else
{
- mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
+ mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
mWidth = mHeight = 0u;
mLoadingState = Dali::ResourceLoadingFailed;
}
+ UploadedSignal().Emit( Dali::Image( this ) );
mLoadingFinished.Emit( Dali::ResourceImage( this ) );
}
Vector2 ResourceImage::GetNaturalSize() const
{
- return Vector2(mWidth, mHeight);
+ return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
}