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 | 225 (void)this->updateCacheAndReturnNonEmpty(); |
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); | |
229 } | 226 } |
230 | 227 |
231 #ifdef SK_DEBUG | 228 #ifdef SK_DEBUG |
232 void SkRasterClip::validate() const { | 229 void SkRasterClip::validate() const { |
233 // can't ever assert that fBW is empty, since we may have called forceGetBW | 230 // can't ever assert that fBW is empty, since we may have called forceGetBW |
234 if (fIsBW) { | 231 if (fIsBW) { |
235 SkASSERT(fAA.isEmpty()); | 232 SkASSERT(fAA.isEmpty()); |
236 } | 233 } |
237 | 234 |
238 fBW.validate(); | 235 fBW.validate(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 fBlitter = blitter; | 270 fBlitter = blitter; |
274 } else { | 271 } else { |
275 const SkAAClip& aaclip = clip.aaRgn(); | 272 const SkAAClip& aaclip = clip.aaRgn(); |
276 fBWRgn.setRect(aaclip.getBounds()); | 273 fBWRgn.setRect(aaclip.getBounds()); |
277 fAABlitter.init(blitter, &aaclip); | 274 fAABlitter.init(blitter, &aaclip); |
278 // now our return values | 275 // now our return values |
279 fClipRgn = &fBWRgn; | 276 fClipRgn = &fBWRgn; |
280 fBlitter = &fAABlitter; | 277 fBlitter = &fAABlitter; |
281 } | 278 } |
282 } | 279 } |
OLD | NEW |