[Text] Add some more trace marker for text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / text-typesetter.cpp
index 343f6cb..4a3474b 100644 (file)
@@ -20,7 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/trace.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 #include <memory.h>
 
 // INTERNAL INCLUDES
@@ -40,6 +42,8 @@ namespace Text
 {
 namespace
 {
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
+
 const float HALF(0.5f);
 const float ONE_AND_A_HALF(1.5f);
 
@@ -447,7 +451,7 @@ void DrawUnderline(
 
         for(uint32_t x = xRangeMin; x < xRangeMax; x++)
         {
-          if(dashGap == 0 && dashWidth > 0)
+          if(Dali::EqualsZero(dashGap) && dashWidth > 0)
           {
             // Note : this is same logic as bitmap[y][x] = underlineColor;
             *(bitmapBuffer + x) = packedUnderlineColor;
@@ -749,7 +753,7 @@ inline Devel::PixelBuffer CreateTransparentImageBuffer(const uint32_t bufferWidt
   if(Pixel::RGBA8888 == pixelFormat)
   {
     const uint32_t bufferSizeInt  = bufferWidth * bufferHeight;
-    const size_t bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
+    const size_t   bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
     memset(imageBuffer.GetBuffer(), 0, bufferSizeChar);
   }
   else
@@ -881,6 +885,7 @@ ViewModel* Typesetter::GetViewModel()
 
 PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirection::Type textDirection, RenderBehaviour behaviour, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat)
 {
+  DALI_TRACE_BEGIN(gTraceFilter, "DALI_TEXT_RENDERING_TYPESETTER");
   // @todo. This initial implementation for a TextLabel has only one visible page.
 
   // Elides the text if needed.
@@ -945,7 +950,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
   const uint32_t bufferHeight = static_cast<uint32_t>(size.height);
 
   const uint32_t bufferSizeInt  = bufferWidth * bufferHeight;
-  const size_t bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
+  const size_t   bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
 
   //Elided text in ellipsis at START could start on index greater than 0
   auto startIndexOfGlyphs = mModel->GetStartIndexOfElidedGlyphs();
@@ -1070,6 +1075,8 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
   // Create the final PixelData for the combined image buffer
   PixelData pixelData = Devel::PixelBuffer::Convert(imageBuffer);
 
+  DALI_TRACE_END(gTraceFilter, "DALI_TEXT_RENDERING_TYPESETTER");
+
   return pixelData;
 }