- float scaleX = static_cast<float>( mWidth ) / mParsedSvg->width;
- float scaleY = static_cast<float>( mHeight ) / mParsedSvg->height;
- float scale = scaleX < scaleY ? scaleX : scaleY;
- unsigned int bufferStride = mWidth*Pixel::GetBytesPerPixel( Pixel::RGBA8888 );
- unsigned int bufferSize = bufferStride * mHeight;
-
- unsigned char* buffer = new unsigned char [bufferSize];
- nsvgRasterize(rasterizer, mParsedSvg, 0.f,0.f,scale,
- buffer, mWidth, mHeight,
- bufferStride );
-
- mPixelData = Dali::PixelData::New( buffer, bufferSize, mWidth, mHeight, Pixel::RGBA8888, Dali::PixelData::DELETE_ARRAY );
+ // Already loaded
+ mLoadSuccess = true;
+ return;
+ }
+
+ Dali::Vector<uint8_t> buffer;
+
+ if(!mUrl.IsLocalResource())
+ {
+ if(!Dali::FileLoader::DownloadFileSynchronously(mUrl.GetUrl(), buffer))
+ {
+ DALI_LOG_ERROR("Failed to download file! [%s]\n", mUrl.GetUrl().c_str());
+ return;
+ }
+ }
+ else
+ {
+ if(!Dali::FileLoader::ReadFile(mUrl.GetUrl(), buffer))
+ {
+ DALI_LOG_ERROR("Failed to read file! [%s]\n", mUrl.GetUrl().c_str());
+ return;
+ }