/*
- * 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.
// EXTERNAL INCLUDES
#include <dali/integration-api/adaptor-framework/adaptor.h>
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
-
namespace Dali
{
namespace Toolkit
return internal;
}
-uint32_t AsyncImageLoader::LoadAnimatedImage(Dali::AnimatedImageLoading animatedImageLoading,
- uint32_t frameIndex)
+uint32_t AsyncImageLoader::LoadAnimatedImage(Dali::AnimatedImageLoading animatedImageLoading,
+ uint32_t frameIndex,
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
if(!mIsLoadThreadStarted)
{
mLoadThread.Start();
mIsLoadThreadStarted = true;
}
- mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, animatedImageLoading, frameIndex));
+ mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, animatedImageLoading, frameIndex, preMultiplyOnLoad));
return mLoadTaskId;
}
FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection,
- DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad,
+ bool loadPlanes)
{
if(!mIsLoadThreadStarted)
{
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, loadPlanes));
- 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;
}
{
if(mPixelBufferLoadedSignal.GetConnectionCount() > 0)
{
- mPixelBufferLoadedSignal.Emit(next->id, next->pixelBuffer);
+ mPixelBufferLoadedSignal.Emit(next->id, next->pixelBuffers);
}
else if(mLoadedSignal.GetConnectionCount() > 0)
{
PixelData pixelData;
- if(next->pixelBuffer)
+ if(!next->pixelBuffers.empty())
{
- pixelData = Devel::PixelBuffer::Convert(next->pixelBuffer);
+ pixelData = Devel::PixelBuffer::Convert(next->pixelBuffers[0]);
}
mLoadedSignal.Emit(next->id, pixelData);
}