Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(981)

Side by Side Diff: src/core/SkRasterClip.h

Issue 452533002: Revert of add isRect() check to AAClip, to detect if a soft-clip is really just an irect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkRasterClip.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkRasterClip_DEFINED 8 #ifndef SkRasterClip_DEFINED
9 #define SkRasterClip_DEFINED 9 #define SkRasterClip_DEFINED
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 bool fIsBW; 82 bool fIsBW;
83 // these 2 are caches based on querying the right obj based on fIsBW 83 // these 2 are caches based on querying the right obj based on fIsBW
84 bool fIsEmpty; 84 bool fIsEmpty;
85 bool fIsRect; 85 bool fIsRect;
86 86
87 bool computeIsEmpty() const { 87 bool computeIsEmpty() const {
88 return fIsBW ? fBW.isEmpty() : fAA.isEmpty(); 88 return fIsBW ? fBW.isEmpty() : fAA.isEmpty();
89 } 89 }
90 90
91 bool computeIsRect() const { 91 bool computeIsRect() const {
92 return fIsBW ? fBW.isRect() : fAA.isRect(); 92 return fIsBW ? fBW.isRect() : false;
93 } 93 }
94 94
95 bool updateCacheAndReturnNonEmpty(bool detectAARect = true) { 95 bool updateCacheAndReturnNonEmpty() {
96 fIsEmpty = this->computeIsEmpty(); 96 fIsEmpty = this->computeIsEmpty();
97
98 // detect that our computed AA is really just a (hard-edged) rect
99 if (detectAARect && !fIsEmpty && !fIsBW && fAA.isRect()) {
100 fBW.setRect(fAA.getBounds());
101 fAA.setEmpty(); // don't need this guy anymore
102 fIsBW = true;
103 }
104
105 fIsRect = this->computeIsRect(); 97 fIsRect = this->computeIsRect();
106 return !fIsEmpty; 98 return !fIsEmpty;
107 } 99 }
108 100
109 void convertToAA(); 101 void convertToAA();
110 }; 102 };
111 103
112 class SkAutoRasterClipValidate : SkNoncopyable { 104 class SkAutoRasterClipValidate : SkNoncopyable {
113 public: 105 public:
114 SkAutoRasterClipValidate(const SkRasterClip& rc) : fRC(rc) { 106 SkAutoRasterClipValidate(const SkRasterClip& rc) : fRC(rc) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 154
163 private: 155 private:
164 SkRegion fBWRgn; 156 SkRegion fBWRgn;
165 SkAAClipBlitter fAABlitter; 157 SkAAClipBlitter fAABlitter;
166 // what we return 158 // what we return
167 const SkRegion* fClipRgn; 159 const SkRegion* fClipRgn;
168 SkBlitter* fBlitter; 160 SkBlitter* fBlitter;
169 }; 161 };
170 162
171 #endif 163 #endif
OLDNEW
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkRasterClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698