From 737b89471a0a4dac5133f31f9a036df4d41cbcb1 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Sat, 6 May 2023 14:48:07 +0900 Subject: [PATCH] examples: ++performance test Add masking to figure out the perf result. --- src/examples/Performance.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/examples/Performance.cpp b/src/examples/Performance.cpp index 48cb67b3..3316c940 100644 --- a/src/examples/Performance.cpp +++ b/src/examples/Performance.cpp @@ -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)); }