mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 04:24:28 +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;
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue