X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-loader%2Fimage-load-thread.cpp;h=dae742dc1e23183801badcf10eb3db9bee1316fd;hp=179734a10671b19aaf3a5eba27d4f51381ff04cc;hb=3a2dfe800fe4ec8214f42b28b3851ea8b8ffc72b;hpb=37d747586c7385a57c2376b708795c46d607f14d diff --git a/dali-toolkit/internal/image-loader/image-load-thread.cpp b/dali-toolkit/internal/image-loader/image-load-thread.cpp index 179734a..dae742d 100644 --- a/dali-toolkit/internal/image-loader/image-load-thread.cpp +++ b/dali-toolkit/internal/image-loader/image-load-thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -33,6 +33,24 @@ namespace Toolkit namespace Internal { +LoadingTask::LoadingTask( uint32_t id, Dali::AnimatedImageLoading animatedImageLoading, uint32_t frameIndex ) +: pixelBuffer(), + url(), + id( id ), + dimensions(), + fittingMode(), + samplingMode(), + orientationCorrection(), + preMultiplyOnLoad( DevelAsyncImageLoader::PreMultiplyOnLoad::OFF ), + isMaskTask( false ), + maskPixelBuffer(), + contentScale( 1.0f ), + cropToMask( false ), + animatedImageLoading( animatedImageLoading ), + frameIndex( frameIndex ) +{ +} + LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dimensions, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection, DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad ) : pixelBuffer(), @@ -46,7 +64,9 @@ LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dim isMaskTask( false ), maskPixelBuffer(), contentScale( 1.0f ), - cropToMask( false ) + cropToMask( false ), + animatedImageLoading(), + frameIndex( 0u ) { } @@ -63,13 +83,19 @@ LoadingTask::LoadingTask( uint32_t id, Devel::PixelBuffer pixelBuffer, Devel::Pi isMaskTask( true ), maskPixelBuffer( maskPixelBuffer ), contentScale( contentScale ), - cropToMask( cropToMask ) + cropToMask( cropToMask ), + animatedImageLoading(), + frameIndex( 0u ) { } void LoadingTask::Load() -{ - if( url.IsLocalResource() ) +{; + if( animatedImageLoading ) + { + pixelBuffer = animatedImageLoading.LoadFrame( frameIndex ); + } + else if( url.IsLocalResource() ) { pixelBuffer = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection ); } @@ -140,7 +166,6 @@ void ImageLoadThread::Run() void ImageLoadThread::AddTask( LoadingTask* task ) { bool wasEmpty = false; - { // Lock while adding task to the queue ConditionalWait::ScopedLock lock( mConditionalWait );