api: set default value nullptr for user convenience.
authorHermet Park <chuneon.park@samsung.com>
Thu, 9 Sep 2021 02:57:07 +0000 (11:57 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Tue, 14 Sep 2021 01:14:27 +0000 (10:14 +0900)
inc/thorvg.h
src/examples/AnimateMasking.cpp
test/testScene.cpp
test/testSwCanvasBase.cpp

index eee73c8..a4ca04d 100644 (file)
@@ -473,7 +473,7 @@ public:
      *
      * @note The Update behavior can be asynchronous if the assigned thread number is greater than zero.
      */
-    virtual Result update(Paint* paint) noexcept;
+    virtual Result update(Paint* paint = nullptr) noexcept;
 
     /**
      * @brief Request the canvas to draw the Paint objects.
index 4b506e2..7f1ba23 100644 (file)
@@ -107,7 +107,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress)
     pMaskShape->translate(0 , progress * 300);
     pMask->translate(0 , progress * 300);
 
-    canvas->update(nullptr);
+    canvas->update();
 }
 
 void transitSwCb(Elm_Transit_Effect *effect, Elm_Transit* transit, double progress)
index f52c5d0..17fa3e5 100644 (file)
@@ -90,7 +90,7 @@ TEST_CASE("Scene Clear And Reuse Shape", "[tvgScene]")
 
     REQUIRE(scene->push(move(shape)) == Result::Success);
     REQUIRE(canvas->push(move(scene)) == Result::Success);
-    REQUIRE(canvas->update(nullptr) == Result::Success);
+    REQUIRE(canvas->update() == Result::Success);
 
     //No deallocate shape.
     REQUIRE(pScene->clear(false) == Result::Success);
index c1c8ae6..1f4927e 100644 (file)
@@ -61,7 +61,7 @@ TEST_CASE("Pushing Paints", "[tvgSwCanvasBase]")
     REQUIRE(canvas->push(move(Scene::gen())) == Result::Success);
 
     //Cases by contexts.
-    REQUIRE(canvas->update(nullptr) == Result::Success);
+    REQUIRE(canvas->update() == Result::Success);
 
     REQUIRE(canvas->push(move(Shape::gen())) == Result::Success);
     REQUIRE(canvas->push(move(Shape::gen())) == Result::Success);
@@ -135,11 +135,11 @@ TEST_CASE("Clear", "[tvgSwCanvasBase]")
         REQUIRE(canvas2->push(move(shape2)) == Result::Success);
     }
 
-    REQUIRE(canvas->update(nullptr) == Result::Success);
+    REQUIRE(canvas->update() == Result::Success);
     REQUIRE(canvas->clear() == Result::Success);
     REQUIRE(canvas->clear(false) == Result::Success);
 
-    REQUIRE(canvas2->update(nullptr) == Result::Success);
+    REQUIRE(canvas2->update() == Result::Success);
     REQUIRE(canvas2->clear(false) == Result::Success);
     REQUIRE(canvas2->clear() == Result::Success);
 
@@ -158,7 +158,7 @@ TEST_CASE("Update", "[tvgSwCanvasBase]")
     uint32_t buffer[100*100];
     REQUIRE(canvas->target(buffer, 100, 100, 100, SwCanvas::Colorspace::ARGB8888) == Result::Success);
 
-    REQUIRE(canvas->update(nullptr) == Result::InsufficientCondition);
+    REQUIRE(canvas->update() == Result::InsufficientCondition);
 
     REQUIRE(canvas->push(move(Shape::gen())) == Result::Success);
 
@@ -170,9 +170,9 @@ TEST_CASE("Update", "[tvgSwCanvasBase]")
     auto ptr = shape.get();
     REQUIRE(canvas->push(move(shape)) == Result::Success);
     REQUIRE(canvas->update(ptr) == Result::Success);
-    REQUIRE(canvas->update(nullptr) == Result::Success);
+    REQUIRE(canvas->update() == Result::Success);
     REQUIRE(canvas->draw() == Result::Success);
-    REQUIRE(canvas->update(nullptr) == Result::InsufficientCondition);
+    REQUIRE(canvas->update() == Result::InsufficientCondition);
 
     REQUIRE(canvas->clear() == Result::Success);
 
@@ -243,4 +243,4 @@ TEST_CASE("Asynchronized Drawing", "[tvgSwCanvasBase]")
     REQUIRE(canvas->sync() == Result::Success);
 
     REQUIRE(Initializer::term(CanvasEngine::Sw) == Result::Success);
-}
\ No newline at end of file
+}