mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
api: set default value nullptr for user convenience.
This commit is contained in:
parent
8c4197a8a5
commit
79933d9efa
4 changed files with 10 additions and 10 deletions
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue