From 49ced00ee221d46c48c900360a01952730f7d62e Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 11 Nov 2021 13:04:16 +0900 Subject: [PATCH] common paint: code refactoring renamed internal variable. no logical changes. --- src/lib/tvgPaint.cpp | 16 ++++++++-------- src/lib/tvgPaint.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib/tvgPaint.cpp b/src/lib/tvgPaint.cpp index 60e3bfd..18f261f 100644 --- a/src/lib/tvgPaint.cpp +++ b/src/lib/tvgPaint.cpp @@ -101,7 +101,7 @@ Paint* Paint::Impl::duplicate() if (rTransform) { ret->pImpl->rTransform = new RenderTransform(); *ret->pImpl->rTransform = *rTransform; - ret->pImpl->flag |= RenderUpdateFlag::Transform; + ret->pImpl->renderFlag |= RenderUpdateFlag::Transform; } ret->pImpl->opacity = opacity; @@ -123,7 +123,7 @@ bool Paint::Impl::rotate(float degree) rTransform = new RenderTransform(); } rTransform->degree = degree; - if (!rTransform->overriding) flag |= RenderUpdateFlag::Transform; + if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; return true; } @@ -138,7 +138,7 @@ bool Paint::Impl::scale(float factor) rTransform = new RenderTransform(); } rTransform->scale = factor; - if (!rTransform->overriding) flag |= RenderUpdateFlag::Transform; + if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; return true; } @@ -154,7 +154,7 @@ bool Paint::Impl::translate(float x, float y) } rTransform->x = x; rTransform->y = y; - if (!rTransform->overriding) flag |= RenderUpdateFlag::Transform; + if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; return true; } @@ -186,7 +186,7 @@ bool Paint::Impl::render(RenderMethod& renderer) void* Paint::Impl::update(RenderMethod& renderer, const RenderTransform* pTransform, uint32_t opacity, Array& clips, uint32_t pFlag) { - if (flag & RenderUpdateFlag::Transform) { + if (renderFlag & RenderUpdateFlag::Transform) { if (!rTransform) return nullptr; if (!rTransform->update()) { delete(rTransform); @@ -219,8 +219,8 @@ void* Paint::Impl::update(RenderMethod& renderer, const RenderTransform* pTransf /* 2. Main Update */ void *edata = nullptr; - auto newFlag = static_cast(pFlag | flag); - flag = RenderUpdateFlag::None; + auto newFlag = static_cast(pFlag | renderFlag); + renderFlag = RenderUpdateFlag::None; opacity = (opacity * this->opacity) / 255; if (rTransform && pTransform) { @@ -373,7 +373,7 @@ Result Paint::opacity(uint8_t o) noexcept if (pImpl->opacity == o) return Result::Success; pImpl->opacity = o; - pImpl->flag |= RenderUpdateFlag::Color; + pImpl->renderFlag |= RenderUpdateFlag::Color; return Result::Success; } diff --git a/src/lib/tvgPaint.h b/src/lib/tvgPaint.h index f69499c..f2b681a 100644 --- a/src/lib/tvgPaint.h +++ b/src/lib/tvgPaint.h @@ -52,7 +52,7 @@ namespace tvg { StrategyMethod* smethod = nullptr; RenderTransform *rTransform = nullptr; - uint32_t flag = RenderUpdateFlag::None; + uint32_t renderFlag = RenderUpdateFlag::None; Paint* cmpTarget = nullptr; CompositeMethod cmpMethod = CompositeMethod::None; uint8_t opacity = 255; @@ -75,7 +75,7 @@ namespace tvg if (!rTransform) return false; } rTransform->override(m); - flag |= RenderUpdateFlag::Transform; + renderFlag |= RenderUpdateFlag::Transform; return true; } @@ -147,9 +147,9 @@ namespace tvg return inst->dispose(renderer); } - void* update(RenderMethod& renderer, const RenderTransform* transform, uint32_t opacity, Array& clips, RenderUpdateFlag flag) override + void* update(RenderMethod& renderer, const RenderTransform* transform, uint32_t opacity, Array& clips, RenderUpdateFlag renderFlag) override { - return inst->update(renderer, transform, opacity, clips, flag); + return inst->update(renderer, transform, opacity, clips, renderFlag); } bool render(RenderMethod& renderer) override -- 2.7.4