Remove ResourceReady before rasterization in SvgVisual
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / svg / svg-rasterize-thread.cpp
index 767bfb0..08e416e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -77,24 +77,10 @@ void RasterizingTask::Load()
 
 void RasterizingTask::Rasterize()
 {
-  if(mWidth <= 0u || mHeight <= 0u)
+  Devel::PixelBuffer pixelBuffer = mVectorRenderer.Rasterize(mWidth, mHeight);
+  if(!pixelBuffer)
   {
-    DALI_LOG_ERROR("RasterizingTask::Rasterize: Size is zero!\n");
-    return;
-  }
-
-  Devel::PixelBuffer pixelBuffer = Devel::PixelBuffer::New(mWidth, mHeight, Dali::Pixel::RGBA8888);
-
-  uint32_t defaultWidth, defaultHeight;
-  mVectorRenderer.GetDefaultSize(defaultWidth, defaultHeight);
-
-  float scaleX = static_cast<float>(mWidth) / static_cast<float>(defaultWidth);
-  float scaleY = static_cast<float>(mHeight) / static_cast<float>(defaultHeight);
-  float scale  = scaleX < scaleY ? scaleX : scaleY;
-
-  if(!mVectorRenderer.Rasterize(pixelBuffer, scale))
-  {
-    DALI_LOG_ERROR("RasterizingTask::Rasterize: Rasterize is failed! [%s]\n", mUrl.GetUrl().c_str());
+    DALI_LOG_ERROR("Rasterize is failed! [%s]\n", mUrl.GetUrl().c_str());
     return;
   }
 
@@ -159,7 +145,7 @@ void SvgRasterizeThread::AddTask(RasterizingTaskPtr task)
     // Lock while adding task to the queue
     ConditionalWait::ScopedLock lock(mConditionalWait);
     wasEmpty = mRasterizeTasks.empty();
-    if(!wasEmpty && task != NULL)
+    if(!wasEmpty && task)
     {
       // Remove the tasks with the same renderer.
       // Older task which waiting to rasterize and apply the svg to the same renderer is expired.
@@ -278,7 +264,7 @@ void SvgRasterizeThread::ApplyRasterizedSVGToSampler()
   UnregisterProcessor();
 }
 
-void SvgRasterizeThread::Process()
+void SvgRasterizeThread::Process(bool postProcessor)
 {
   ApplyRasterizedSVGToSampler();
 }