From: Eunki, Hong Date: Fri, 24 Mar 2023 03:24:15 +0000 (+0900) Subject: Reset AsyncTask what we don't need anymore X-Git-Tag: dali_2.2.20~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0e761f11ac3a6a65ae7af1d48e559268e5316b3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Reset AsyncTask what we don't need anymore Change-Id: Iffdf810c296f793fd6b0bb437e995baa5a1d2009 Signed-off-by: Eunki, Hong --- diff --git a/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.cpp b/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.cpp index 2fff921..e9c8a97 100644 --- a/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.cpp +++ b/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.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. @@ -205,6 +205,8 @@ void CanvasView::ApplyRasterizedImage(CanvasRendererRasterizingTaskPtr task) } } + mRasterizingTask.Reset(); // We don't need it anymore + //If there are accumulated changes to CanvasRenderer during Rasterize, Rasterize once again. if(mCanvasRenderer && mCanvasRenderer.IsCanvasChanged()) { diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index 265c2fe..8fcbf52 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -109,7 +109,11 @@ void SvgVisual::OnInitialize() if(IsSynchronousLoadingRequired() && mImageUrl.IsLocalResource()) { mLoadingTask->Process(); - mLoadingTask.Reset(); // We don't need it now + if(!mLoadingTask->HasSucceeded()) + { + mLoadFailed = true; + } + mLoadingTask.Reset(); // We don't need it anymore. } else { @@ -319,7 +323,7 @@ void SvgVisual::AddRasterizationTask(const Vector2& size) { mRasterizingTask->Process(); ApplyRasterizedImage(mRasterizingTask); - mRasterizingTask.Reset(); // We don't need it now + mRasterizingTask.Reset(); // We don't need it anymore. } else { @@ -421,6 +425,16 @@ void SvgVisual::ApplyRasterizedImage(SvgTaskPtr task) ResourceReady(Toolkit::Visual::ResourceStatus::FAILED); } + + // We don't need to keep tasks anymore. reset now. + if(task == mLoadingTask) + { + mLoadingTask.Reset(); + } + if(task == mRasterizingTask) + { + mRasterizingTask.Reset(); + } } void SvgVisual::OnSetTransform()