+ if(!mVectorRenderer.Load(mEncodedImageBuffer.GetRawBuffer()))
+ {
+ mLoadFailed = true;
+ }
+
+ // We don't need to hold image buffer anymore.
+ mEncodedImageBuffer.Reset();
+ }
+ else if(mImageUrl.IsLocalResource())
+ {
+ if(!mVectorRenderer.Load(mImageUrl.GetUrl()))
+ {
+ mLoadFailed = true;
+ }
+ }
+ else
+ {
+ Dali::Vector<uint8_t> remoteData;
+ if(!Dali::FileLoader::DownloadFileSynchronously(mImageUrl.GetUrl(), remoteData) || // Failed if we fail to download json file,
+ !mVectorRenderer.Load(remoteData)) // or download data is not valid vector animation file.
+ {
+ mLoadFailed = true;
+ }
+ }
+
+ if(mLoadFailed)
+ {
+ DALI_LOG_ERROR("VectorAnimationTask::Load: Load failed [%s]\n", mImageUrl.GetUrl().c_str());
+ mLoadRequest = false;
+ if(!synchronousLoading && mLoadCompletedCallback)
+ {
+ mVectorAnimationThread.AddEventTriggerCallback(mLoadCompletedCallback.get());
+ }
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream oss;
+ oss << "[url:" << mImageUrl.GetUrl() << "]";
+ // DALI_TRACE_END(gTraceFilter, "DALI_LOTTIE_LOADING_TASK"); ///< TODO : Open it if we can control trace log level
+ DALI_LOG_RELEASE_INFO("END: DALI_LOTTIE_LOADING_TASK %s", oss.str().c_str());
+ }
+#endif