mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
test: ++blending
This commit is contained in:
parent
f36455048a
commit
3512beab9f
1 changed files with 61 additions and 0 deletions
|
@ -232,3 +232,64 @@ TEST_CASE("Composition", "[tvgPaint]")
|
|||
REQUIRE(shape->composite(&pComp2) == CompositeMethod::InvLumaMask);
|
||||
REQUIRE(pComp == pComp2);
|
||||
}
|
||||
|
||||
TEST_CASE("Blending", "[tvgPaint]")
|
||||
{
|
||||
auto shape = Shape::gen();
|
||||
REQUIRE(shape);
|
||||
|
||||
//Default
|
||||
REQUIRE(shape->blend() == BlendMethod::Normal);
|
||||
|
||||
//Add
|
||||
REQUIRE(shape->blend(BlendMethod::Add) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Add);
|
||||
|
||||
//Screen
|
||||
REQUIRE(shape->blend(BlendMethod::Screen) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Screen);
|
||||
|
||||
//Multiply
|
||||
REQUIRE(shape->blend(BlendMethod::Multiply) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Multiply);
|
||||
|
||||
//Overlay
|
||||
REQUIRE(shape->blend(BlendMethod::Overlay) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Overlay);
|
||||
|
||||
//Difference
|
||||
REQUIRE(shape->blend(BlendMethod::Difference) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Difference);
|
||||
|
||||
//Exclusion
|
||||
REQUIRE(shape->blend(BlendMethod::Exclusion) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Exclusion);
|
||||
|
||||
//SrcOver
|
||||
REQUIRE(shape->blend(BlendMethod::SrcOver) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::SrcOver);
|
||||
|
||||
//Darken
|
||||
REQUIRE(shape->blend(BlendMethod::Darken) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Darken);
|
||||
|
||||
//Lighten
|
||||
REQUIRE(shape->blend(BlendMethod::Lighten) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::Lighten);
|
||||
|
||||
//ColorDodge
|
||||
REQUIRE(shape->blend(BlendMethod::ColorDodge) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::ColorDodge);
|
||||
|
||||
//ColorBurn
|
||||
REQUIRE(shape->blend(BlendMethod::ColorBurn) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::ColorBurn);
|
||||
|
||||
//HardLight
|
||||
REQUIRE(shape->blend(BlendMethod::HardLight) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::HardLight);
|
||||
|
||||
//SoftLight
|
||||
REQUIRE(shape->blend(BlendMethod::SoftLight) == Result::Success);
|
||||
REQUIRE(shape->blend() == BlendMethod::SoftLight);
|
||||
}
|
Loading…
Add table
Reference in a new issue