| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkLatticeIter.h" | 8 #include "SkLatticeIter.h" |
| 9 #include "SkRect.h" | 9 #include "SkRect.h" |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 dst->set(fDstX[x], fDstY[y], fDstX[x + 1], fDstY[y + 1]); | 221 dst->set(fDstX[x], fDstY[y], fDstX[x + 1], fDstY[y + 1]); |
| 222 if (fSrcX.count() - 1 == ++fCurrX) { | 222 if (fSrcX.count() - 1 == ++fCurrX) { |
| 223 fCurrX = 0; | 223 fCurrX = 0; |
| 224 fCurrY += 1; | 224 fCurrY += 1; |
| 225 if (fCurrY >= fSrcY.count() - 1) { | 225 if (fCurrY >= fSrcY.count() - 1) { |
| 226 fDone = true; | 226 fDone = true; |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 return true; | 229 return true; |
| 230 } | 230 } |
| 231 |
| 232 int SkLatticeIter::numRects() const { |
| 233 SkASSERT(fSrcX.count() == fDstX.count() && fSrcY.count() == fDstY.count()); |
| 234 SkASSERT(fSrcX.count() >= 2 && fDstX.count() >= 2); |
| 235 return (fSrcX.count() - 1) * (fDstX.count() - 1); |
| 236 } |
| OLD | NEW |