diff --git a/src/lib/sw_engine/tvgSwRenderer.cpp b/src/lib/sw_engine/tvgSwRenderer.cpp index 2458cdb6..ac5464e0 100644 --- a/src/lib/sw_engine/tvgSwRenderer.cpp +++ b/src/lib/sw_engine/tvgSwRenderer.cpp @@ -32,7 +32,7 @@ namespace tvg { SwShape shape; const Shape* sdata; SwSize clip; - const Matrix* transform; + Matrix* transform; RenderUpdateFlag flags; future progress; }; @@ -139,6 +139,7 @@ bool SwRenderer::dispose(const Shape& sdata, void *data) if (!task) return true; if (task->progress.valid()) task->progress.get(); shapeFree(task->shape); + if (task->transform) free(task->transform); free(task); return true; } @@ -158,8 +159,14 @@ void* SwRenderer::prepare(const Shape& sdata, void* data, const RenderTransform* task->sdata = &sdata; task->clip = {static_cast(surface.w), static_cast(surface.h)}; - if (transform) task->transform = &transform->m; - else task->transform = nullptr; + if (transform) { + if (!task->transform) task->transform = static_cast(malloc(sizeof(Matrix))); + assert(task->transform); + *task->transform = transform->m; + } else { + if (task->transform) free(task->transform); + task->transform = nullptr; + } task->flags = flags; diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index 9a79c6ed..29ecf27b 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -201,7 +201,6 @@ static bool _updateBBox(SwOutline* outline, SwBBox& bbox) ++pt; for(uint32_t i = 1; i < outline->ptsCnt; ++i, ++pt) { - assert(pt); if (xMin > pt->x) xMin = pt->x; if (xMax < pt->x) xMax = pt->x; if (yMin > pt->y) yMin = pt->y; @@ -567,7 +566,6 @@ void shapeFree(SwShape& shape) { shapeDelOutline(shape); rleFree(shape.rle); - shapeDelFill(shape); if (shape.stroke) {