mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
examples Texmap: extending the feature scenario.
This commit is contained in:
parent
f4c9c4189e
commit
36919dc70f
1 changed files with 13 additions and 3 deletions
|
@ -71,9 +71,19 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
||||||
|
|
||||||
if (picture->mesh(triangles, 4) != tvg::Result::Success) return;
|
if (picture->mesh(triangles, 4) != tvg::Result::Success) return;
|
||||||
|
|
||||||
picture->translate(100, 100);
|
//Masking + Opacity
|
||||||
|
auto picture2 = tvg::cast<tvg::Picture>(picture->duplicate());
|
||||||
|
picture2->translate(400, 400);
|
||||||
|
picture2->opacity(200);
|
||||||
|
|
||||||
|
auto mask = tvg::Shape::gen();
|
||||||
|
mask->appendCircle(700, 700, 200, 200);
|
||||||
|
mask->fill(255, 255, 255, 255);
|
||||||
|
picture2->composite(std::move(mask), tvg::CompositeMethod::AlphaMask);
|
||||||
|
|
||||||
|
|
||||||
canvas->push(std::move(picture));
|
canvas->push(std::move(picture));
|
||||||
|
canvas->push(std::move(picture2));
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
@ -168,9 +178,9 @@ int main(int argc, char **argv)
|
||||||
elm_init(argc, argv);
|
elm_init(argc, argv);
|
||||||
|
|
||||||
if (tvgEngine == tvg::CanvasEngine::Sw) {
|
if (tvgEngine == tvg::CanvasEngine::Sw) {
|
||||||
createSwView();
|
createSwView(1024, 1024);
|
||||||
} else {
|
} else {
|
||||||
createGlView();
|
createGlView(1024, 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_run();
|
elm_run();
|
||||||
|
|
Loading…
Add table
Reference in a new issue