Determine priority type for each task 43/289443/5
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 7 Mar 2023 23:32:57 +0000 (08:32 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 9 Mar 2023 07:11:22 +0000 (16:11 +0900)
For example, remote image loading might be heavy process.
So let we give some hints for this tasks priority as LOW.
If we set priority as low, Remote image loading didn't use
whole AsyncTaskManager's threads.

Change-Id: Ife22517deff47b7f4da769bad2b97f472fa8efef
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-scene3d/internal/common/environment-map-load-task.cpp
dali-scene3d/internal/common/model-load-task.cpp
dali-toolkit/internal/image-loader/loading-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp

index d847f46..5ff0d51 100644 (file)
 // INTERNAL INCLUDES
 #include <dali-scene3d/public-api/loader/environment-map-loader.h>
 
-
 namespace Dali
 {
 namespace Scene3D
 {
 namespace Internal
 {
-
 EnvironmentMapLoadTask::EnvironmentMapLoadTask(const std::string& environmentMapUrl, Dali::Scene3D::EnvironmentMapType environmentMapType, CallbackBase* callback)
 : AsyncTask(callback),
   mEnvironmentMapUrl(environmentMapUrl),
@@ -60,7 +58,7 @@ bool EnvironmentMapLoadTask::HasSucceeded() const
 
 Dali::Texture EnvironmentMapLoadTask::GetLoadedTexture()
 {
-  return (HasSucceeded()) ? mEnvironmentMapData.GetTexture() : Texture();;
+  return (HasSucceeded()) ? mEnvironmentMapData.GetTexture() : Texture();
 }
 
 } // namespace Internal
index b979c22..6456b6d 100644 (file)
@@ -55,8 +55,7 @@ void ModelLoadTask::Process()
     mResourceDirectoryUrl = std::string(modelUrl.parent_path()) + "/";
   }
 
-  Dali::Scene3D::Loader::ResourceBundle::PathProvider pathProvider = [&](Dali::Scene3D::Loader::ResourceType::Value type)
-  {
+  Dali::Scene3D::Loader::ResourceBundle::PathProvider pathProvider = [&](Dali::Scene3D::Loader::ResourceType::Value type) {
     return mResourceDirectoryUrl;
   };
 
index 11f83a8..e81b16f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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,7 +76,7 @@ LoadingTask::LoadingTask(uint32_t id, Dali::AnimatedImageLoading animatedImageLo
 }
 
 LoadingTask::LoadingTask(uint32_t id, const VisualUrl& url, ImageDimensions dimensions, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection, DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad, bool loadPlanes, CallbackBase* callback)
-: AsyncTask(callback),
+: AsyncTask(callback, url.GetProtocolType() == VisualUrl::ProtocolType::REMOTE ? AsyncTask::PriorityType::LOW : AsyncTask::PriorityType::HIGH),
   url(url),
   encodedImageBuffer(),
   id(id),
index 158ef83..40f1a64 100644 (file)
@@ -46,7 +46,7 @@ Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(Debug::NoLogging,
 } // unnamed namespace
 
 VectorAnimationTask::VectorAnimationTask(VisualFactoryCache& factoryCache)
-: AsyncTask(MakeCallback(this, &VectorAnimationTask::TaskCompleted), AsyncTask::ThreadType::WORKER_THREAD),
+: AsyncTask(MakeCallback(this, &VectorAnimationTask::TaskCompleted), AsyncTask::PriorityType::HIGH, AsyncTask::ThreadType::WORKER_THREAD),
   mUrl(),
   mVectorRenderer(VectorAnimationRenderer::New()),
   mAnimationData(),