mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: fix context handle passimg by ref
Use reference insted of value for context passing
This commit is contained in:
parent
d2d93792df
commit
222e8a25a1
2 changed files with 8 additions and 8 deletions
|
@ -333,7 +333,7 @@ void WgRenderDataPaint::updateClips(tvg::Array<tvg::RenderData> &clips) {
|
|||
// WgRenderDataShape
|
||||
//***********************************************************************
|
||||
|
||||
void WgRenderDataShape::appendShape(WgContext context, const WgVertexBuffer& vertexBuffer)
|
||||
void WgRenderDataShape::appendShape(WgContext& context, const WgVertexBuffer& vertexBuffer)
|
||||
{
|
||||
if (vertexBuffer.vcount < 3) return;
|
||||
Point pmin{}, pmax{};
|
||||
|
@ -344,7 +344,7 @@ void WgRenderDataShape::appendShape(WgContext context, const WgVertexBuffer& ver
|
|||
}
|
||||
|
||||
|
||||
void WgRenderDataShape::appendStroke(WgContext context, const WgVertexBufferInd& vertexBufferInd)
|
||||
void WgRenderDataShape::appendStroke(WgContext& context, const WgVertexBufferInd& vertexBufferInd)
|
||||
{
|
||||
if (vertexBufferInd.vcount < 3) return;
|
||||
Point pmin{}, pmax{};
|
||||
|
@ -376,7 +376,7 @@ void WgRenderDataShape::updateAABB(const Matrix& tr) {
|
|||
}
|
||||
|
||||
|
||||
void WgRenderDataShape::updateMeshes(WgContext &context, const RenderShape &rshape, const Matrix& tr)
|
||||
void WgRenderDataShape::updateMeshes(WgContext& context, const RenderShape &rshape, const Matrix& tr)
|
||||
{
|
||||
releaseMeshes(context);
|
||||
strokeFirst = rshape.stroke ? rshape.stroke->strokeFirst : false;
|
||||
|
@ -452,7 +452,7 @@ void WgRenderDataShape::updateMeshes(WgContext &context, const RenderShape &rsha
|
|||
}
|
||||
|
||||
|
||||
void WgRenderDataShape::proceedStrokes(WgContext context, const RenderStroke* rstroke, float tbeg, float tend, const WgVertexBuffer& buff)
|
||||
void WgRenderDataShape::proceedStrokes(WgContext& context, const RenderStroke* rstroke, float tbeg, float tend, const WgVertexBuffer& buff)
|
||||
{
|
||||
assert(rstroke);
|
||||
static WgVertexBufferInd strokesGenerator;
|
||||
|
@ -479,7 +479,7 @@ void WgRenderDataShape::proceedStrokes(WgContext context, const RenderStroke* rs
|
|||
}
|
||||
|
||||
|
||||
void WgRenderDataShape::releaseMeshes(WgContext &context)
|
||||
void WgRenderDataShape::releaseMeshes(WgContext& context)
|
||||
{
|
||||
meshGroupStrokesBBox.release(context);
|
||||
meshGroupStrokes.release(context);
|
||||
|
|
|
@ -125,12 +125,12 @@ struct WgRenderDataShape: public WgRenderDataPaint
|
|||
bool strokeFirst{};
|
||||
FillRule fillRule{};
|
||||
|
||||
void appendShape(WgContext context, const WgVertexBuffer& vertexBuffer);
|
||||
void appendStroke(WgContext context, const WgVertexBufferInd& vertexBufferInd);
|
||||
void appendShape(WgContext& context, const WgVertexBuffer& vertexBuffer);
|
||||
void appendStroke(WgContext& context, const WgVertexBufferInd& vertexBufferInd);
|
||||
void updateBBox(Point pmin, Point pmax);
|
||||
void updateAABB(const Matrix& tr);
|
||||
void updateMeshes(WgContext& context, const RenderShape& rshape, const Matrix& tr);
|
||||
void proceedStrokes(WgContext context, const RenderStroke* rstroke, float tbeg, float tend, const WgVertexBuffer& buff);
|
||||
void proceedStrokes(WgContext& context, const RenderStroke* rstroke, float tbeg, float tend, const WgVertexBuffer& buff);
|
||||
void releaseMeshes(WgContext& context);
|
||||
void release(WgContext& context) override;
|
||||
Type type() override { return Type::Shape; };
|
||||
|
|
Loading…
Add table
Reference in a new issue