diff options
Diffstat (limited to 'experimental/sksg/SkSGNode.cpp')
-rw-r--r-- | experimental/sksg/SkSGNode.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/experimental/sksg/SkSGNode.cpp b/experimental/sksg/SkSGNode.cpp index d3e804070c..13e9864147 100644 --- a/experimental/sksg/SkSGNode.cpp +++ b/experimental/sksg/SkSGNode.cpp @@ -127,20 +127,20 @@ const SkRect& Node::revalidate(InvalidationController* ic, const SkMatrix& ctm) return fBounds; } - SkRect prevBounds; - if (this->hasSelfInval()) { - prevBounds = fBounds; - } - - fBounds = this->onRevalidate(ic, ctm); - - if (this->hasSelfInval()) { - ic->inval(prevBounds, ctm); - if (fBounds != prevBounds) { - ic->inval(fBounds, ctm); + const auto result = this->onRevalidate(ic, ctm); + const auto selfDamage = result.fReval == Damage::kForceSelf || + (this->hasSelfInval() && result.fReval != Damage::kBlockSelf); + + if (selfDamage) { + // old bounds + ic->inval(fBounds, ctm); + if (result.fBounds != fBounds) { + // new bounds + ic->inval(result.fBounds, ctm); } } + fBounds = result.fBounds; fFlags &= ~(kInvalSelf_Flag | kInvalDescendant_Flag); return fBounds; |