aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-02-05 10:48:18 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-05 10:48:18 -0800
commite43bf8554a50afe60382a640e9234a2583178f7b (patch)
tree69bfba978c3a482707406eb4c608b8b3538bf2cc /include
parent75c8af293816b94cd8fd9a3d9b3a4d6e052dedfe (diff)
parent43356962b0685a89e232a038b2b33162da04517d (diff)
downloadexternal_skia-e43bf8554a50afe60382a640e9234a2583178f7b.zip
external_skia-e43bf8554a50afe60382a640e9234a2583178f7b.tar.gz
external_skia-e43bf8554a50afe60382a640e9234a2583178f7b.tar.bz2
Merge "Take into accunt the edge type when doing a clip quickreject."
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 40b5c56..3a10ca4 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