wg_engine: support trimmed fill

This commit changes the API behavior.

@Issue: https://github.com/thorvg/thorvg/issues/3118
This commit is contained in:
Mira Grudzinska 2025-02-19 00:03:37 +09:00 committed by Hermet Park
parent c4747e6802
commit 05a5a7ea0b

View file

@ -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()) {
auto trimbuff = pool->reqVertexBuffer(scale);
pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
appendShape(context, path_buff);
});
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) { pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) {
appendShape(context, path_buff); appendShape(context, path_buff);
if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool); if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool);
}); }, rshape.trimpath());
}
// 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)) {