diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-18 14:49:04 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-26 22:43:44 +0200 |
commit | 81949c2cd23e07db9a078b2206b3e43847e051b9 (patch) | |
tree | fc5f074b9563de0b2fc49fc338a39e863040b6c6 /thirdparty/thorvg/src/lib/tvgPaint.h | |
parent | b905959f4382020b424fa093c380e163a7a7f404 (diff) | |
download | redot-engine-81949c2cd23e07db9a078b2206b3e43847e051b9.tar.gz |
thorvg: Update to 0.10.7
Fixes #81618.
Diffstat (limited to 'thirdparty/thorvg/src/lib/tvgPaint.h')
-rw-r--r-- | thirdparty/thorvg/src/lib/tvgPaint.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/thirdparty/thorvg/src/lib/tvgPaint.h b/thirdparty/thorvg/src/lib/tvgPaint.h index c00238a070..c020a7dffd 100644 --- a/thirdparty/thorvg/src/lib/tvgPaint.h +++ b/thirdparty/thorvg/src/lib/tvgPaint.h @@ -42,10 +42,10 @@ namespace tvg { virtual ~StrategyMethod() {} - virtual bool dispose(RenderMethod& renderer) = 0; + virtual bool dispose(RenderMethod& renderer) = 0; //return true if the deletion is allowed. virtual void* update(RenderMethod& renderer, const RenderTransform* transform, Array<RenderData>& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper) = 0; //Return engine data if it has. virtual bool render(RenderMethod& renderer) = 0; - virtual bool bounds(float* x, float* y, float* w, float* h) = 0; + virtual bool bounds(float* x, float* y, float* w, float* h, bool stroking) = 0; virtual RenderRegion bounds(RenderMethod& renderer) const = 0; virtual Paint* duplicate() = 0; virtual Iterator* iterator() = 0; @@ -68,6 +68,7 @@ namespace tvg uint8_t ctxFlag = ContextFlag::Invalid; uint8_t id; uint8_t opacity = 255; + uint8_t refCnt = 1; ~Impl() { @@ -79,6 +80,18 @@ namespace tvg delete(rTransform); } + uint8_t ref() + { + if (refCnt == 255) TVGERR("RENDERER", "Corrupted reference count!"); + return (++refCnt); + } + + uint8_t unref() + { + if (refCnt == 0) TVGERR("RENDERER", "Corrupted reference count!"); + return (--refCnt); + } + void method(StrategyMethod* method) { smethod = method; @@ -147,7 +160,7 @@ namespace tvg bool rotate(float degree); bool scale(float factor); bool translate(float x, float y); - bool bounds(float* x, float* y, float* w, float* h, bool transformed); + bool bounds(float* x, float* y, float* w, float* h, bool transformed, bool stroking); RenderData update(RenderMethod& renderer, const RenderTransform* pTransform, Array<RenderData>& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper = false); bool render(RenderMethod& renderer); Paint* duplicate(); @@ -162,9 +175,9 @@ namespace tvg PaintMethod(T* _inst) : inst(_inst) {} ~PaintMethod() {} - bool bounds(float* x, float* y, float* w, float* h) override + bool bounds(float* x, float* y, float* w, float* h, bool stroking) override { - return inst->bounds(x, y, w, h); + return inst->bounds(x, y, w, h, stroking); } RenderRegion bounds(RenderMethod& renderer) const override |