diff --git a/inc/thorvg.h b/inc/thorvg.h index eee73c8c..a4ca04d8 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -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. diff --git a/src/examples/AnimateMasking.cpp b/src/examples/AnimateMasking.cpp index 4b506e21..7f1ba236 100644 --- a/src/examples/AnimateMasking.cpp +++ b/src/examples/AnimateMasking.cpp @@ -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) diff --git a/test/testScene.cpp b/test/testScene.cpp index f52c5d06..17fa3e55 100644 --- a/test/testScene.cpp +++ b/test/testScene.cpp @@ -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); diff --git a/test/testSwCanvasBase.cpp b/test/testSwCanvasBase.cpp index c1c8ae63..1f4927e5 100644 --- a/test/testSwCanvasBase.cpp +++ b/test/testSwCanvasBase.cpp @@ -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 +}