examples: ++performance test

Add masking to figure out the perf result.
This commit is contained in:
Hermet Park 2023-05-06 14:48:07 +09:00 committed by Hermet Park
parent 4893746eb2
commit 737b89471a

View file

@ -35,10 +35,14 @@ void tvgDrawCmds(tvg::Canvas* canvas)
{
if (!canvas) return;
auto picture = tvg::Picture::gen();
auto mask = tvg::Shape::gen();
mask->appendCircle(WIDTH/2, HEIGHT/2, WIDTH/2, HEIGHT/2);
mask->fill(255, 255, 255, 100);
auto picture = tvg::Picture::gen();
picture->load(EXAMPLE_DIR"/tiger.svg");
picture->size(WIDTH, HEIGHT);
picture->composite(move(mask), tvg::CompositeMethod::AlphaMask);
pPicture = picture.get();
canvas->push(move(picture));
}