X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-loader%2Fasync-image-loader-impl.cpp;h=c4dc2a05e52b0438de376a8152d2ac8972f48c96;hb=df88ef210c240cab1fdef98dcd6b2c07e6940eb7;hp=ea10924db49929b7d1bfbbdc23a42ee0f5498840;hpb=a4b26c19783f73d4e0f3a9fdd23f5a1810406734;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp b/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp index ea10924..c4dc2a0 100644 --- a/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp +++ b/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -21,9 +21,6 @@ // EXTERNAL INCLUDES #include -// INTERNAL INCLUDES -#include - namespace Dali { namespace Toolkit @@ -74,24 +71,24 @@ uint32_t AsyncImageLoader::Load(const VisualUrl& url, mLoadThread.Start(); mIsLoadThreadStarted = true; } - if(url.IsBufferResource()) - { - auto visualFactory = Toolkit::VisualFactory::Get(); - if(visualFactory) - { - // Get EncodedImageBuffer from texturemanager - // and make new LoadingTask with buffer - auto& textureManager = GetImplementation(visualFactory).GetTextureManager(); + mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); - const EncodedImageBuffer& encodedBuffer = textureManager.GetEncodedImageBuffer(url.GetUrl()); + return mLoadTaskId; +} - mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); - } - } - else +uint32_t AsyncImageLoader::LoadEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad) +{ + if(!mIsLoadThreadStarted) { - mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); + mLoadThread.Start(); + mIsLoadThreadStarted = true; } + mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedImageBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); return mLoadTaskId; } @@ -138,7 +135,8 @@ void AsyncImageLoader::ProcessLoadedImage() { if(mPixelBufferLoadedSignal.GetConnectionCount() > 0) { - mPixelBufferLoadedSignal.Emit(next->id, next->pixelBuffer); + std::vector pixelBuffers{next->pixelBuffer}; + mPixelBufferLoadedSignal.Emit(next->id, pixelBuffers); } else if(mLoadedSignal.GetConnectionCount() > 0) {