diff options
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 40b5c56171..3a10ca4031 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -772,14 +772,31 @@ private: mutable SkRectCompareType fLocalBoundsCompareType; mutable bool fLocalBoundsCompareTypeDirty; + mutable SkRectCompareType fLocalBoundsCompareTypeBW; + mutable bool fLocalBoundsCompareTypeDirtyBW; + + /* Get the local clip bounds with an anti-aliased edge. + */ const SkRectCompareType& getLocalClipBoundsCompareType() const { - if (fLocalBoundsCompareTypeDirty) { - this->computeLocalClipBoundsCompareType(); - fLocalBoundsCompareTypeDirty = false; + return getLocalClipBoundsCompareType(kAA_EdgeType); + } + + const SkRectCompareType& getLocalClipBoundsCompareType(EdgeType et) const { + if (et == kAA_EdgeType) { + if (fLocalBoundsCompareTypeDirty) { + this->computeLocalClipBoundsCompareType(et); + fLocalBoundsCompareTypeDirty = false; + } + return fLocalBoundsCompareType; + } else { + if (fLocalBoundsCompareTypeDirtyBW) { + this->computeLocalClipBoundsCompareType(et); + fLocalBoundsCompareTypeDirtyBW = false; + } + return fLocalBoundsCompareTypeBW; } - return fLocalBoundsCompareType; } - void computeLocalClipBoundsCompareType() const; + void computeLocalClipBoundsCompareType(EdgeType et) const; }; /** Stack helper class to automatically call restoreToCount() on the canvas |