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