Merge "[Tizen] CanvasRenderer: Fix changed update when buffer committed" into tizen accepted/tizen/unified/20210416.143554 submit/tizen/20210416.153505
authorjunsu choi <jsuya.choi@samsung.com>
Wed, 14 Apr 2021 06:15:41 +0000 (06:15 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 14 Apr 2021 06:15:41 +0000 (06:15 +0000)
12 files changed:
dali/devel-api/adaptor-framework/canvas-renderer-shape.cpp
dali/devel-api/adaptor-framework/canvas-renderer-shape.h
dali/integration-api/adaptor-framework/adaptor.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/canvas-renderer/common/shape-impl.cpp
dali/internal/canvas-renderer/common/shape-impl.h
dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp
dali/internal/canvas-renderer/tizen/shape-impl-tizen.h
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.h

index 4dd6b75..56fc4ce 100644 (file)
@@ -78,6 +78,11 @@ bool CanvasRenderer::Shape::Close()
   return GetImplementation(*this).Close();
 }
 
+bool CanvasRenderer::Shape::ResetPath()
+{
+  return GetImplementation(*this).ResetPath();
+}
+
 bool CanvasRenderer::Shape::SetFillColor(Vector4 color)
 {
   return GetImplementation(*this).SetFillColor(color);
index ddd621c..91ca295 100644 (file)
@@ -180,6 +180,13 @@ public:
   bool Close();
 
   /**
+   * @brief Reset the added path(rect, circle, path, etc...) information.
+   * Color and Stroke information are keeped.
+   * @return Returns True when it's successful. False otherwise.
+   */
+  bool ResetPath();
+
+  /**
    * @brief Set the color to use for filling the path.
    * @param[in] color The color value.
    * @return Returns True when it's successful. False otherwise.
index 43b4913..9bcb8c6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_ADAPTOR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -406,15 +406,17 @@ public:
   /**
    * @brief Register a processor implementing the Integration::Processor interface with dali-core.
    * @param[in] processor the Processor to register
+   * @param[in] postProcessor set this processor required to be called after size negotiation. Default is false.
    * @note using this api does not maintain the processor's lifecycle, must be done elsewhere.
    */
-  void RegisterProcessor(Integration::Processor& processor);
+  void RegisterProcessor(Integration::Processor& processor, bool postProcessor = false);
 
   /**
    * @brief Unregister a previously registered processor from dali-core.
    * @param[in] processor the Processor to unregister
+   * @param[in] postProcessor True if the processor to be unregister is for post processor.
    */
-  void UnregisterProcessor(Integration::Processor& processor);
+  void UnregisterProcessor(Integration::Processor& processor, bool postProcessor = false);
 
   /**
    * @brief Get the list of windows created.
index 2767044..c849f93 100644 (file)
@@ -1106,14 +1106,14 @@ const LogFactoryInterface& Adaptor::GetLogFactory()
   return *mEnvironmentOptions;
 }
 
-void Adaptor::RegisterProcessor(Integration::Processor& processor)
+void Adaptor::RegisterProcessor(Integration::Processor& processor, bool postProcessor)
 {
-  GetCore().RegisterProcessor(processor);
+  GetCore().RegisterProcessor(processor, postProcessor);
 }
 
-void Adaptor::UnregisterProcessor(Integration::Processor& processor)
+void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postProcessor)
 {
-  GetCore().UnregisterProcessor(processor);
+  GetCore().UnregisterProcessor(processor, postProcessor);
 }
 
 bool Adaptor::IsMultipleWindowSupported() const
index 7992342..b69ad05 100644 (file)
@@ -442,12 +442,12 @@ public:
   /**
    * @copydoc Dali::Adaptor::RegisterProcessor
    */
-  void RegisterProcessor(Integration::Processor& processor);
+  void RegisterProcessor(Integration::Processor& processor, bool postProcessor);
 
   /**
    * @coydoc Dali::Adaptor::UnregisterProcessor
    */
-  void UnregisterProcessor(Integration::Processor& processor);
+  void UnregisterProcessor(Integration::Processor& processor, bool postProcessor);
 
   /**
    * Check MultipleWindow is supported
index 31af12b..d320604 100644 (file)
@@ -230,14 +230,14 @@ const LogFactoryInterface& Adaptor::GetLogFactory()
   return mImpl->GetLogFactory();
 }
 
-void Adaptor::RegisterProcessor(Integration::Processor& processor)
+void Adaptor::RegisterProcessor(Integration::Processor& processor, bool postProcessor)
 {
-  mImpl->RegisterProcessor(processor);
+  mImpl->RegisterProcessor(processor, postProcessor);
 }
 
-void Adaptor::UnregisterProcessor(Integration::Processor& processor)
+void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postProcessor)
 {
-  mImpl->UnregisterProcessor(processor);
+  mImpl->UnregisterProcessor(processor, postProcessor);
 }
 
 Dali::WindowContainer Adaptor::GetWindows() const
index 3b3e850..b71e7a6 100644 (file)
@@ -63,6 +63,11 @@ bool Shape::Close()
   return false;
 }
 
+bool Shape::ResetPath()
+{
+  return false;
+}
+
 bool Shape::SetFillColor(Vector4 color)
 {
   return false;
index e5b485d..2b61935 100644 (file)
@@ -82,11 +82,16 @@ public:
   virtual bool AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector2 endPoint);
 
   /**
-   * @copydoc Dali::CanvasRenderer::Shape::AddClose
+   * @copydoc Dali::CanvasRenderer::Shape::Close
    */
   virtual bool Close();
 
   /**
+   * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+   */
+  virtual bool ResetPath();
+
+  /**
    * @copydoc Dali::CanvasRenderer::Shape::SetFillColor
    */
   virtual bool SetFillColor(Vector4 color);
index 5e66c54..5351261 100644 (file)
@@ -184,6 +184,27 @@ bool ShapeTizen::Close()
   return true;
 }
 
+bool ShapeTizen::ResetPath()
+{
+#ifdef THORVG_SUPPORT
+  if(!mTvgShape)
+  {
+    DALI_LOG_ERROR("Shape is null\n");
+    return false;
+  }
+
+  if(static_cast<tvg::Shape*>(mTvgShape)->reset() != tvg::Result::Success)
+  {
+    DALI_LOG_ERROR("reset() fail.\n");
+    return false;
+  }
+  Drawable::SetChanged(true);
+  return true;
+#else
+  return false;
+#endif
+}
+
 bool ShapeTizen::SetFillColor(Vector4 color)
 {
   if(!mTvgShape)
index 578a135..156133b 100644 (file)
@@ -81,6 +81,11 @@ public:
   bool Close() override;
 
   /**
+   * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+   */
+  bool ResetPath() override;
+
+  /**
    * @copydoc Dali::CanvasRenderer::Shape::SetFillColor
    */
   bool SetFillColor(Vector4 color) override;
index 79a4871..ac6d09d 100644 (file)
@@ -217,6 +217,27 @@ bool ShapeUbuntu::Close()
 #endif
 }
 
+bool ShapeUbuntu::ResetPath()
+{
+#ifdef THORVG_SUPPORT
+  if(!mTvgShape)
+  {
+    DALI_LOG_ERROR("Shape is null\n");
+    return false;
+  }
+
+  if(static_cast<tvg::Shape*>(mTvgShape)->reset() != tvg::Result::Success)
+  {
+    DALI_LOG_ERROR("reset() fail.\n");
+    return false;
+  }
+  Drawable::SetChanged(true);
+  return true;
+#else
+  return false;
+#endif
+}
+
 bool ShapeUbuntu::SetFillColor(Vector4 color)
 {
 #ifdef THORVG_SUPPORT
index 491a2bd..bd4b087 100644 (file)
@@ -83,6 +83,11 @@ public:
   bool Close() override;
 
   /**
+   * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+   */
+  bool ResetPath() override;
+
+  /**
    * @copydoc Dali::CanvasRenderer::Shape::SetFillColor
    */
   bool SetFillColor(Vector4 color) override;