From ef65af1eadc3b63227afe9d4e145a1ef0e5640c6 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 20 Jun 2023 11:23:08 +0900 Subject: [PATCH] Load remote svg image as low priority Since we can load svg file as remote, make remote svg image load task as low priority Change-Id: Ib0604ef8cda045641c331f367bb02e85c8304e35 Signed-off-by: Eunki, Hong --- dali-toolkit/internal/visuals/svg/svg-task.cpp | 9 ++++----- dali-toolkit/internal/visuals/svg/svg-task.h | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dali-toolkit/internal/visuals/svg/svg-task.cpp b/dali-toolkit/internal/visuals/svg/svg-task.cpp index 67cff0f..7b8ef29 100644 --- a/dali-toolkit/internal/visuals/svg/svg-task.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-task.cpp @@ -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. @@ -32,9 +32,8 @@ namespace Toolkit { namespace Internal { - -SvgTask::SvgTask(VectorImageRenderer vectorRenderer, CallbackBase* callback) -: AsyncTask(callback), +SvgTask::SvgTask(VectorImageRenderer vectorRenderer, CallbackBase* callback, AsyncTask::PriorityType priorityType) +: AsyncTask(callback, priorityType), mVectorRenderer(vectorRenderer), mHasSucceeded(false) { @@ -56,7 +55,7 @@ VectorImageRenderer SvgTask::GetRenderer() } SvgLoadingTask::SvgLoadingTask(VectorImageRenderer vectorRenderer, const VisualUrl& url, float dpi, CallbackBase* callback) -: SvgTask(vectorRenderer, callback), +: SvgTask(vectorRenderer, callback, url.GetProtocolType() == VisualUrl::ProtocolType::REMOTE ? AsyncTask::PriorityType::LOW : AsyncTask::PriorityType::HIGH), mUrl(url), mDpi(dpi) { diff --git a/dali-toolkit/internal/visuals/svg/svg-task.h b/dali-toolkit/internal/visuals/svg/svg-task.h index 31855b9..89d8f55 100644 --- a/dali-toolkit/internal/visuals/svg/svg-task.h +++ b/dali-toolkit/internal/visuals/svg/svg-task.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_SVG_TASK_H /* - * 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. @@ -55,8 +55,9 @@ public: * Constructor * @param[in] vectorRenderer The vector rasterizer. * @param[in] callback The callback that is called when the operation is completed. + * @param[in] priorityType The priority of this task. */ - SvgTask(VectorImageRenderer vectorRenderer, CallbackBase* callback); + SvgTask(VectorImageRenderer vectorRenderer, CallbackBase* callback, AsyncTask::PriorityType priorityType = AsyncTask::PriorityType::DEFAULT); /** * Destructor. -- 2.7.4