| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDeviceLooper.h" | 8 #include "SkDeviceLooper.h" |
| 9 | 9 |
| 10 SkDeviceLooper::SkDeviceLooper(const SkBitmap& base, | 10 SkDeviceLooper::SkDeviceLooper(const SkBitmap& base, |
| 11 const SkRasterClip& rc, | 11 const SkRasterClip& rc, |
| 12 const SkIRect& bounds, bool aa) | 12 const SkIRect& bounds, bool aa) |
| 13 : fBaseBitmap(base) | 13 : fBaseBitmap(base) |
| 14 , fBaseRC(rc) | 14 , fBaseRC(rc) |
| 15 , fDelta(aa ? kAA_Delta : kBW_Delta) | 15 , fSubsetRC(rc.isForceConservativeRects()) |
| 16 , fDelta(aa ? kAA_Delta : kBW_Delta) |
| 16 { | 17 { |
| 17 // sentinels that next() has not yet been called, and so our mapper function
s | 18 // sentinels that next() has not yet been called, and so our mapper function
s |
| 18 // should not be called either. | 19 // should not be called either. |
| 19 fCurrBitmap = NULL; | 20 fCurrBitmap = NULL; |
| 20 fCurrRC = NULL; | 21 fCurrRC = NULL; |
| 21 | 22 |
| 22 if (!rc.isEmpty()) { | 23 if (!rc.isEmpty()) { |
| 23 // clip must be contained by the bitmap | 24 // clip must be contained by the bitmap |
| 24 SkASSERT(SkIRect::MakeWH(base.width(), base.height()).contains(rc.getBou
nds())); | 25 SkASSERT(SkIRect::MakeWH(base.width(), base.height()).contains(rc.getBou
nds())); |
| 25 } | 26 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 while (next_tile(fClippedBounds, fDelta, &fCurrOffset)) { | 123 while (next_tile(fClippedBounds, fDelta, &fCurrOffset)) { |
| 123 if (this->computeCurrBitmapAndClip()) { | 124 if (this->computeCurrBitmapAndClip()) { |
| 124 return true; | 125 return true; |
| 125 } | 126 } |
| 126 } | 127 } |
| 127 break; | 128 break; |
| 128 } | 129 } |
| 129 fState = kDone_State; | 130 fState = kDone_State; |
| 130 return false; | 131 return false; |
| 131 } | 132 } |
| OLD | NEW |