mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
wg_engine: support trimmed fill
This commit changes the API behavior. @Issue: https://github.com/thorvg/thorvg/issues/3118
This commit is contained in:
parent
c4747e6802
commit
05a5a7ea0b
1 changed files with 5 additions and 16 deletions
|
@ -374,22 +374,11 @@ void WgRenderDataShape::updateMeshes(WgContext& context, const RenderShape &rsha
|
||||||
// path decoded vertex buffer
|
// path decoded vertex buffer
|
||||||
auto pbuff = pool->reqVertexBuffer(scale);
|
auto pbuff = pool->reqVertexBuffer(scale);
|
||||||
|
|
||||||
if (rshape.trimpath()) {
|
pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
|
||||||
auto trimbuff = pool->reqVertexBuffer(scale);
|
appendShape(context, path_buff);
|
||||||
pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
|
if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool);
|
||||||
appendShape(context, path_buff);
|
}, rshape.trimpath());
|
||||||
});
|
|
||||||
trimbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
|
|
||||||
appendShape(context, path_buff);
|
|
||||||
proceedStrokes(context, rshape.stroke, path_buff, pool);
|
|
||||||
}, true);
|
|
||||||
pool->retVertexBuffer(trimbuff);
|
|
||||||
} else {
|
|
||||||
pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
|
|
||||||
appendShape(context, path_buff);
|
|
||||||
if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// update shapes bbox (with empty path handling)
|
// update shapes bbox (with empty path handling)
|
||||||
if ((this->meshGroupShapesBBox.meshes.count > 0 ) ||
|
if ((this->meshGroupShapesBBox.meshes.count > 0 ) ||
|
||||||
(this->meshGroupStrokesBBox.meshes.count > 0)) {
|
(this->meshGroupStrokesBBox.meshes.count > 0)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue