| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |