[Tizen] Change PixelBufferLoadedSignalType
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / image-loader / async-image-loader-impl.cpp
index 412eda7..c4dc2a0 100644 (file)
@@ -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.
@@ -76,6 +76,23 @@ uint32_t AsyncImageLoader::Load(const VisualUrl&                         url,
   return mLoadTaskId;
 }
 
+uint32_t AsyncImageLoader::LoadEncodedImageBuffer(const EncodedImageBuffer&                encodedImageBuffer,
+                                                  ImageDimensions                          dimensions,
+                                                  FittingMode::Type                        fittingMode,
+                                                  SamplingMode::Type                       samplingMode,
+                                                  bool                                     orientationCorrection,
+                                                  DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
+{
+  if(!mIsLoadThreadStarted)
+  {
+    mLoadThread.Start();
+    mIsLoadThreadStarted = true;
+  }
+  mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedImageBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad));
+
+  return mLoadTaskId;
+}
+
 uint32_t AsyncImageLoader::ApplyMask(Devel::PixelBuffer                       pixelBuffer,
                                      Devel::PixelBuffer                       maskPixelBuffer,
                                      float                                    contentScale,
@@ -118,7 +135,8 @@ void AsyncImageLoader::ProcessLoadedImage()
   {
     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)
     {