return;
}
- DALI_LOG_RELEASE_INFO("Request size : %f, %f\n", contentSize.width, contentSize.height);
+ DALI_LOG_RELEASE_INFO("Async render request, size : %f, %f\n", contentSize.width, contentSize.height);
AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_FIXED_SIZE, contentSize, padding, layoutDirection);
TextVisual::UpdateAsyncRenderer(mVisual, parameters);
mTextUpdateNeeded = false;
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/integration-api/pixel-data-integ.h>
+#include <dali/integration-api/trace.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/bidirectional-support.h>
#include <dali-toolkit/internal/text/segmentation.h>
#include <dali-toolkit/internal/text/shaper.h>
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_ASYNC_TEXT_LOADER");
-#endif
-
namespace Dali
{
namespace Toolkit
0.5f, // VerticalAlignment::CENTER
1.0f // VerticalAlignment::BOTTOM
};
+
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_TEXT_ASYNC, false);
} // namespace
namespace Text
{
namespace Internal
{
-
const float TO_POINT_26_DOT_6 = 64.f;
AsyncTextLoader::AsyncTextLoader()
mModuleClearNeeded(false),
mMutex()
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::AsyncTextLoader\n");
-
mModule = Dali::Toolkit::Text::AsyncTextModule::New();
mTextModel = Model::New();
void AsyncTextLoader::Update(AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::Update\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_UPDATE");
if(parameters.text.empty())
{
- DALI_LOG_RELEASE_INFO("Text is empty\n");
+ DALI_LOG_ERROR("Text is empty\n");
return;
}
Size AsyncTextLoader::Layout(AsyncTextParameters& parameters, bool& updated)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::Layout\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_LAYOUT");
////////////////////////////////////////////////////////////////////////////////
// Layout the text.
numberOfCharacters > charactersToGlyph.Count() ||
(lastIndex > charactersToGlyph.Count() && charactersToGlyph.Count() > 0u))
{
- DALI_LOG_ERROR("AsyncTextLoader::Layout: Attempting to access invalid buffer\n");
+ DALI_LOG_ERROR("Attempting to access invalid buffer\n");
DALI_LOG_ERROR("Current text is: %s\n", parameters.text.c_str());
DALI_LOG_ERROR("startIndex: %u, lastIndex: %u, requestedNumberOfCharacters: %u, charactersToGlyph.Count = %lu, glyphsPerCharacter.Count = %lu\n", startIndex, lastIndex, numberOfCharacters, charactersToGlyph.Count(), glyphsPerCharacter.Count());
return Size::ZERO;
mTextModel->mVisualModel->SetLayoutSize(Size::ZERO);
// Nothing else to do if there is no glyphs.
- DALI_LOG_RELEASE_INFO("AsyncTextLoader::Layout no glyphs\n");
+ DALI_LOG_RELEASE_INFO("no glyphs\n");
return Size::ZERO;
}
}
}
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::Layout ControlSize : %f, %f, LayoutSize : %f, %f\n", textLayoutArea.x, textLayoutArea.y, newLayoutSize.x, newLayoutSize.y);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("ControlSize : %f, %f, LayoutSize : %f, %f\n", textLayoutArea.x, textLayoutArea.y, newLayoutSize.x, newLayoutSize.y);
+ }
+#endif
return newLayoutSize;
}
AsyncTextRenderInfo AsyncTextLoader::Render(AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::Render\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_RENDER");
// render test
mTypesetter->SetFontClient(mModule.GetFontClient());
layoutSize.y = parameters.textHeight + (parameters.padding.top + parameters.padding.bottom);
}
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::Render ControlSize : %f, %f, LayoutSize : %f, %f\n", parameters.textWidth, parameters.textHeight, layoutSize.x, layoutSize.y);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("ControlSize : %f, %f, LayoutSize : %f, %f\n", parameters.textWidth, parameters.textHeight, layoutSize.x, layoutSize.y);
+ }
+#endif
// Check the text direction
Toolkit::DevelText::TextDirection::Type textDirection = mIsTextDirectionRTL ? Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT : Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT;
AsyncTextRenderInfo AsyncTextLoader::RenderText(AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::RenderText\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_RENDER_TEXT");
if(parameters.requestType == Async::RENDER_CONSTRAINT)
{
float AsyncTextLoader::ComputeHeightForWidth(AsyncTextParameters& parameters, float width, bool layoutOnly)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::ComputeHeightForWidth\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("ComputeHeightForWidth, width:%f, layoutOnly:%d\n", width, layoutOnly);
+ }
+#endif
float actualWidth = parameters.textWidth;
float actualHeight = parameters.textHeight;
Size AsyncTextLoader::ComputeNaturalSize(AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::ComputeNaturalSize\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("ComputeNaturalSize\n");
+ }
+#endif
float actualWidth = parameters.textWidth;
float actualHeight = parameters.textHeight;
AsyncTextRenderInfo AsyncTextLoader::RenderAutoScroll(AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::RenderAutoScroll\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_RENDER_AUTO_SCROLL");
Size controlSize(parameters.textWidth, parameters.textHeight);
mTextModel->mVisualModel->mControlSize = Size(parameters.textWidth, parameters.textHeight);
}
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::RenderAutoScroll natural size : %f, %f, control size : %f, %f \n", textNaturalSize.x, textNaturalSize.y, controlSize.x, controlSize.y);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("natural size : %f, %f, control size : %f, %f\n", textNaturalSize.x, textNaturalSize.y, controlSize.x, controlSize.y);
+ }
+#endif
// Calculate the actual gap before scrolling wraps.
int textPadding = std::max(controlSize.x - textNaturalSize.x, 0.0f);
if(parameters.isTextFitArrayEnabled)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::RenderTextFit -> TextFitArray\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("AsyncTextLoader::RenderTextFit -> TextFitArray\n");
+ }
+#endif
std::vector<DevelTextLabel::FitOption> fitOptions = parameters.textFitArray;
int numberOfFitOptions = static_cast<int>(fitOptions.size());
}
else if(parameters.isTextFitEnabled)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextLoader::RenderTextFit -> TextFit\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("AsyncTextLoader::RenderTextFit -> TextFit\n");
+ }
+#endif
float minPointSize = parameters.textFitMinSize;
float maxPointSize = parameters.textFitMaxSize;
const char* DALI_TEXT_NUMBER_OF_ASYNC_TEXT_LOADER("DALI_TEXT_NUMBER_OF_ASYNC_TEXT_LOADER");
const int DEFAULT_NUMBER_OF_LOADER = 4;
const uint32_t EMPTY_TASK_ID = 0u;
+
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_TEXT_ASYNC, false);
} // namespace
namespace Text
auto numberOfLoaderString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TEXT_NUMBER_OF_ASYNC_TEXT_LOADER);
int numberOfLoader = numberOfLoaderString ? std::atoi(numberOfLoaderString) : DEFAULT_NUMBER_OF_LOADER;
+ DALI_LOG_RELEASE_INFO("Number of async text loaders:%d\n", numberOfLoader);
+
for(int i = 0; i < numberOfLoader; i ++)
{
Text::AsyncTextLoader loader = Text::AsyncTextLoader::New();
if(observer)
{
- DALI_LOG_RELEASE_INFO("RequestLoad -> connect DestructionSignal to observer : %p, task : %u\n", observer, mTaskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RequestLoad -> connect DestructionSignal to observer : %p, task : %u\n", observer, mTaskId);
+ }
+#endif
observer->ConnectDestructionSignal();
observer->DestructionSignal().Connect(this, &AsyncTextManager::ObserverDestroyed);
}
// Loader move available list -> running list.
Text::AsyncTextLoader loader = GetAvailableLoader();
task->SetLoader(loader);
- DALI_LOG_RELEASE_INFO("RequestLoad -> ob : %p, add task : %u\n", element.mObserver, mTaskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RequestLoad -> ob : %p, add task : %u\n", element.mObserver, mTaskId);
+ }
+#endif
}
else
{
// There is no available loader, add element to waiting queue.
mWaitingTasks[mTaskId] = element;
- DALI_LOG_RELEASE_INFO("RequestLoad -> ob : %p, add waiting task : %u\n", element.mObserver, mTaskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RequestLoad -> ob : %p, add waiting task : %u\n", element.mObserver, mTaskId);
+ }
+#endif
}
Dali::AsyncTaskManager::Get().AddTask(task);
{
if(it->second.mObserver)
{
- DALI_LOG_RELEASE_INFO("RequestCancel -> ob : %p, remove wating task : %u\n", it->second.mObserver, taskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RequestCancel -> ob : %p, remove wating task : %u\n", it->second.mObserver, taskId);
+ }
+#endif
if(it->second.mObserver->DisconnectDestructionSignal())
{
it->second.mObserver->DestructionSignal().Disconnect(this, &AsyncTextManager::ObserverDestroyed);
{
if(it->second.mObserver)
{
- DALI_LOG_RELEASE_INFO("RequestCancel -> ob : %p, remove running task : %u\n", it->second.mObserver, taskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RequestCancel -> ob : %p, remove running task : %u\n", it->second.mObserver, taskId);
+ }
+#endif
if(it->second.mObserver->DisconnectDestructionSignal())
{
it->second.mObserver->DestructionSignal().Disconnect(this, &AsyncTextManager::ObserverDestroyed);
// Find task, execute load complete.
if(it->second.mObserver)
{
- DALI_LOG_RELEASE_INFO("LoadComplete -> ob : %p, remove task : %u\n", it->second.mObserver, taskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("LoadComplete -> ob : %p, remove task : %u\n", it->second.mObserver, taskId);
+ }
+#endif
// TODO : If it fails for any reason, false should be sent.
bool success = true;
if(it->second.mObserver->DisconnectDestructionSignal())
}
else
{
- DALI_LOG_ERROR("LoadComplete -> observer destroyed -> remove task : %u\n", taskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("LoadComplete -> observer destroyed -> remove task : %u\n", taskId);
+ }
+#endif
}
// If a task has completed, we souhld to remove the element from running map.
mRunningTasks.erase(it);
}
else
{
- DALI_LOG_ERROR("LoadComplete -> Running task already removed! : %u\n", taskId);
+ DALI_LOG_WARNING("LoadComplete -> Running task already removed! : %u\n", taskId);
}
for(auto iter = mRunningLoaders.begin(); iter != mRunningLoaders.end(); ++iter)
// TODO : AsyncTaskManager does not know that the IsReady has changed after the task is added.
// Wake up by adding an empty task to AsyncTaskManager.
WakeUpAsyncTaskManager();
- DALI_LOG_RELEASE_INFO("LoadComplete task : %u -> new task -> ob : %p, add task : %u\n", taskId, element.mObserver, watingTaskId);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("LoadComplete task : %u -> new task -> ob : %p, add task : %u\n", taskId, element.mObserver, watingTaskId);
+ }
+#endif
}
}
- DALI_LOG_RELEASE_INFO("LoadComplete -> available loaders : %lu, running loaders : %lu, waiting tasks : %lu\n", mAvailableLoaders.size(), mRunningLoaders.size(), mWaitingTasks.size());
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("LoadComplete -> available loaders : %lu, running loaders : %lu, waiting tasks : %lu\n", mAvailableLoaders.size(), mRunningLoaders.size(), mWaitingTasks.size());
+ }
+#endif
}
void AsyncTextManager::ObserverDestroyed(TextLoadObserver* observer)
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextManager::ObserverDestroyed observer : %p\n", observer);
-
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("-->AsyncTextManager::ObserverDestroyed observer : %p\n", observer);
+ }
+#endif
for(auto it = mRunningTasks.begin(); it != mRunningTasks.end();)
{
if(it->second.mObserver == observer)
mHyphenation(),
mMultilanguageSupport()
{
- DALI_LOG_RELEASE_INFO("-->AsyncTextModule::AsyncTextModule\n");
bool connnectLocaleChangedSignal = false;
mBidirectionalSupport = TextAbstraction::BidirectionalSupport::New();
{
namespace
{
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_TEXT_ASYNC, false);
} // namespace
TextLoadingTask::TextLoadingTask(const uint32_t id, Text::AsyncTextParameters parameters, CallbackBase* callback)
{
return;
}
-
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Process start\n");
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_ASYNC_LOADING_TASK_PROCESS");
Load();
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Process end\n");
}
bool TextLoadingTask::IsReady()
{
if(mParameters.isAutoScrollEnabled && !mParameters.isMultiLine)
{
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Load RenderAutoScroll\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RenderAutoScroll\n");
+ }
+#endif
mRenderInfo = mLoader.RenderAutoScroll(mParameters);
}
else if(mParameters.isTextFitEnabled || mParameters.isTextFitArrayEnabled)
{
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Load RenderTextFit\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RenderTextFit\n");
+ }
+#endif
mRenderInfo = mLoader.RenderTextFit(mParameters);
}
else
{
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Load RenderText\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("RenderText\n");
+ }
+#endif
mRenderInfo = mLoader.RenderText(mParameters);
}
}
case Text::Async::COMPUTE_NATURAL_SIZE:
{
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Load GetNaturalSize\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("GetNaturalSize\n");
+ }
+#endif
mRenderInfo = mLoader.GetNaturalSize(mParameters);
}
break;
case Text::Async::COMPUTE_HEIGHT_FOR_WIDTH:
{
- DALI_LOG_RELEASE_INFO("-->TextLoadingTask::Load GetHeightForWidth\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("GetHeightForWidth\n");
+ }
+#endif
mRenderInfo = mLoader.GetHeightForWidth(mParameters);
}
break;
namespace
{
DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_TEXT_PERFORMANCE_MARKER, false);
+DALI_INIT_TRACE_FILTER(gTraceFilter2, DALI_TRACE_TEXT_ASYNC, false);
const int CUSTOM_PROPERTY_COUNT(3); // uTextColorAnimatable, uHasMultipleTextColors, requireRender
{
if(mController->GetRenderMode() != DevelTextLabel::Render::SYNC && mIsRenderTaskRunning)
{
- DALI_LOG_RELEASE_INFO("-->TextVisual::DoSetOffScene RequestCancel:%u\n", mRenderTaskId);
Text::AsyncTextManager::Get().RequestCancel(mRenderTaskId);
mIsRenderTaskRunning = false;
}
{
if(mController->GetRenderMode() != DevelTextLabel::Render::SYNC)
{
- DALI_LOG_RELEASE_INFO("-->TextVisual::UpdateRenderer return; AsyncTextLoad processing\n");
return;
}
// From async text manager
void TextVisual::LoadComplete(bool loadingSuccess, TextInformation textInformation)
{
- DALI_LOG_RELEASE_INFO("-->TextVisual::LoadComplete\n");
-
Text::AsyncTextParameters parameters = textInformation.parameters;
+#ifdef TRACE_ENABLED
+ if(gTraceFilter2 && gTraceFilter2->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("LoadComplete, success:%d, type:%d\n", loadingSuccess, parameters.requestType);
+ }
+#endif
+
switch (parameters.requestType)
{
case Text::Async::RENDER_FIXED_SIZE:
void TextVisual::RequestAsyncSizeComputation(Text::AsyncTextParameters& parameters)
{
- DALI_LOG_RELEASE_INFO("-->TextVisual::RequestAsyncSizeComputation RequestLoad\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter2 && gTraceFilter2->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("Request size computation, type:%d\n", parameters.requestType);
+ }
+#endif
switch (parameters.requestType)
{
Text::AsyncTextManager::Get().RequestCancel(mRenderTaskId);
}
- DALI_LOG_RELEASE_INFO("-->TextVisual::UpdateAsyncRenderer RequestLoad\n");
+#ifdef TRACE_ENABLED
+ if(gTraceFilter2 && gTraceFilter2->IsTraceEnabled())
+ {
+ DALI_LOG_RELEASE_INFO("Request render, type:%d\n", parameters.requestType);
+ }
+#endif
mIsRenderTaskRunning = true;
TextLoadObserver* textLoadObserver = this;