/*
- * 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
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);
+ return mLoadTaskId;
+}
- mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, 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);
+ std::vector<Devel::PixelBuffer> pixelBuffers{next->pixelBuffer};
+ mPixelBufferLoadedSignal.Emit(next->id, pixelBuffers);
}
else if(mLoadedSignal.GetConnectionCount() > 0)
{