X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fimaging%2Fcommon%2Fgif-loading.cpp;h=111d1cf5cdbca2a1da3ec1c4686874418d518b93;hb=80759a22f22c5b6e82b16a456703840b6f7cc746;hp=16057f746dd6861b502996d97f50e30a12f61885;hpb=7410006a864d66a1f4c7416eabdb669a00c3a4f9;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/imaging/common/gif-loading.cpp b/dali/internal/imaging/common/gif-loading.cpp index 16057f7..111d1cf 100644 --- a/dali/internal/imaging/common/gif-loading.cpp +++ b/dali/internal/imaging/common/gif-loading.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #define IMG_TOO_BIG( w, h ) \ ( ( static_cast(w) * static_cast(h) ) >= \ @@ -1192,7 +1193,8 @@ struct GifLoading::Impl { public: Impl( const std::string& url, bool isLocalResource ) - : mUrl( url ) + : mUrl( url ), + mMutex() { loaderInfo.gif = nullptr; int error; @@ -1232,6 +1234,7 @@ public: std::string mUrl; LoaderInfo loaderInfo; ImageProperties imageProperties; + Mutex mMutex; }; AnimatedImageLoadingPtr GifLoading::New( const std::string &url, bool isLocalResource ) @@ -1255,6 +1258,7 @@ bool GifLoading::LoadNextNFrames( uint32_t frameStartIndex, int count, std::vect int error; bool ret = false; + Mutex::ScopedLock lock( mImpl->mMutex ); const int bufferSize = mImpl->imageProperties.w * mImpl->imageProperties.h * sizeof( uint32_t ); DALI_LOG_INFO( gGifLoadingLogFilter, Debug::Concise, "LoadNextNFrames( frameStartIndex:%d, count:%d )\n", frameStartIndex, count ); @@ -1285,6 +1289,7 @@ Dali::Devel::PixelBuffer GifLoading::LoadFrame( uint32_t frameIndex ) int error; Dali::Devel::PixelBuffer pixelBuffer; + Mutex::ScopedLock lock( mImpl->mMutex ); DALI_LOG_INFO( gGifLoadingLogFilter, Debug::Concise, "LoadFrame( frameIndex:%d )\n", frameIndex ); pixelBuffer = Dali::Devel::PixelBuffer::New( mImpl->imageProperties.w, mImpl->imageProperties.h, Dali::Pixel::RGBA8888 );