From ba09de4c4be66cc07790f23b0f3a925f47340e3e Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Fri, 5 Feb 2010 20:46:05 +0000 Subject: respect edgetype in quickreject git-svn-id: http://skia.googlecode.com/svn/trunk@489 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkCanvas.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'include/core/SkCanvas.h') 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 -- cgit v1.2.3