mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-16 04:54:39 +00:00
examples: ++performance test
Add masking to figure out the perf result.
This commit is contained in:
parent
4893746eb2
commit
737b89471a
1 changed files with 5 additions and 1 deletions
|
@ -35,10 +35,14 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
||||||
{
|
{
|
||||||
if (!canvas) return;
|
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->load(EXAMPLE_DIR"/tiger.svg");
|
||||||
picture->size(WIDTH, HEIGHT);
|
picture->size(WIDTH, HEIGHT);
|
||||||
|
picture->composite(move(mask), tvg::CompositeMethod::AlphaMask);
|
||||||
pPicture = picture.get();
|
pPicture = picture.get();
|
||||||
canvas->push(move(picture));
|
canvas->push(move(picture));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue