mRendererUpdateNeeded(false),
mTextRequireRender(false),
mTaskId(0u),
- mIsTaskRunning(false)
+ mSizeTaskId(0u),
+ mIsTaskRunning(false),
+ mIsSizeTaskRunning(false)
{
// Enable the pre-multiplied alpha to improve the text quality
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
{
DALI_LOG_RELEASE_INFO("-->TextVisual::LoadComplete\n");
- mIsTaskRunning = false;
+ Text::AsyncTextParameters parameters = textInformation.parameters;
+
+ if(parameters.requestType == Text::Async::COMPUTE_NATURAL_SIZE || parameters.requestType == Text::Async::COMPUTE_HEIGHT_FOR_WIDTH)
+ {
+ mIsSizeTaskRunning = false;
+ }
+ else
+ {
+ mIsTaskRunning = false;
+ }
Toolkit::Visual::ResourceStatus resourceStatus;
resourceStatus = Toolkit::Visual::ResourceStatus::READY;
Text::AsyncTextRenderInfo renderInfo = textInformation.renderInfo;
- Text::AsyncTextParameters parameters = textInformation.parameters;
if(parameters.requestType == Text::Async::COMPUTE_NATURAL_SIZE || parameters.requestType == Text::Async::COMPUTE_HEIGHT_FOR_WIDTH)
{
{
DALI_LOG_RELEASE_INFO("-->TextVisual::RequestAsyncSizeComputation RequestLoad\n");
+ // This does not mean whether task is actually running or waiting.
+ // It is whether text visual received a completion callback after requesting a task.
+ if(mIsSizeTaskRunning)
+ {
+ Text::AsyncTextManager::Get().RequestCancel(mSizeTaskId);
+ }
+
+ DALI_LOG_RELEASE_INFO("-->TextVisual::UpdateAsyncRenderer RequestLoad\n");
+
+ mIsSizeTaskRunning = true;
TextLoadObserver* textLoadObserver = this;
- Text::AsyncTextManager::Get().RequestLoad(parameters, textLoadObserver);
+ mSizeTaskId = Text::AsyncTextManager::Get().RequestLoad(parameters, textLoadObserver);
}
void TextVisual::UpdateAsyncRenderer(Text::AsyncTextParameters& parameters)
RendererContainer mRendererList;
uint32_t mTaskId; ///< The currently requested task Id.
- bool mIsTaskRunning; ///< Whether the requested task is running or not.
+ uint32_t mSizeTaskId; ///< The currently requested size task Id.
+ bool mIsTaskRunning : 1; ///< Whether the requested task is running or not.
+ bool mIsSizeTaskRunning :1; ///< Whether the requested size task is running or not.
};
} // namespace Internal