From 05a5a7ea0bec7b4aee5631a8b610d9939afdb10b Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Wed, 19 Feb 2025 00:03:37 +0900 Subject: [PATCH] wg_engine: support trimmed fill This commit changes the API behavior. @Issue: https://github.com/thorvg/thorvg/issues/3118 --- src/renderer/wg_engine/tvgWgRenderData.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/renderer/wg_engine/tvgWgRenderData.cpp b/src/renderer/wg_engine/tvgWgRenderData.cpp index 9cbdcaa1..2fdda3d9 100755 --- a/src/renderer/wg_engine/tvgWgRenderData.cpp +++ b/src/renderer/wg_engine/tvgWgRenderData.cpp @@ -374,22 +374,11 @@ void WgRenderDataShape::updateMeshes(WgContext& context, const RenderShape &rsha // path decoded vertex buffer 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) { - appendShape(context, path_buff); - if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool); - }); - } + pbuff->decodePath(rshape, true, [&](const WgVertexBuffer& path_buff) { + appendShape(context, path_buff); + if (rshape.stroke) proceedStrokes(context, rshape.stroke, path_buff, pool); + }, rshape.trimpath()); + // update shapes bbox (with empty path handling) if ((this->meshGroupShapesBBox.meshes.count > 0 ) || (this->meshGroupStrokesBBox.meshes.count > 0)) {