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

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

Issue 443353004: 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/SkRasterClip.h ('k') | tests/AAClipTest.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 #include "SkRasterClip.h" 8 #include "SkRasterClip.h"
9 9
10 10
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 } 215 }
216 return fBW; 216 return fBW;
217 } 217 }
218 218
219 void SkRasterClip::convertToAA() { 219 void SkRasterClip::convertToAA() {
220 AUTO_RASTERCLIP_VALIDATE(*this); 220 AUTO_RASTERCLIP_VALIDATE(*this);
221 221
222 SkASSERT(fIsBW); 222 SkASSERT(fIsBW);
223 fAA.setRegion(fBW); 223 fAA.setRegion(fBW);
224 fIsBW = false; 224 fIsBW = false;
225 (void)this->updateCacheAndReturnNonEmpty(); 225
226 // since we are being explicitly asked to convert-to-aa, we pass false so we don't "optimize"
227 // ourselves back to BW.
228 (void)this->updateCacheAndReturnNonEmpty(false);
226 } 229 }
227 230
228 #ifdef SK_DEBUG 231 #ifdef SK_DEBUG
229 void SkRasterClip::validate() const { 232 void SkRasterClip::validate() const {
230 // can't ever assert that fBW is empty, since we may have called forceGetBW 233 // can't ever assert that fBW is empty, since we may have called forceGetBW
231 if (fIsBW) { 234 if (fIsBW) {
232 SkASSERT(fAA.isEmpty()); 235 SkASSERT(fAA.isEmpty());
233 } 236 }
234 237
235 fBW.validate(); 238 fBW.validate();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 fBlitter = blitter; 273 fBlitter = blitter;
271 } else { 274 } else {
272 const SkAAClip& aaclip = clip.aaRgn(); 275 const SkAAClip& aaclip = clip.aaRgn();
273 fBWRgn.setRect(aaclip.getBounds()); 276 fBWRgn.setRect(aaclip.getBounds());
274 fAABlitter.init(blitter, &aaclip); 277 fAABlitter.init(blitter, &aaclip);
275 // now our return values 278 // now our return values
276 fClipRgn = &fBWRgn; 279 fClipRgn = &fBWRgn;
277 fBlitter = &fAABlitter; 280 fBlitter = &fAABlitter;
278 } 281 }
279 } 282 }
OLDNEW
« no previous file with comments | « src/core/SkRasterClip.h ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698