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 #ifndef SkLatticeIter_DEFINED | 8 #ifndef SkLatticeIter_DEFINED |
9 #define SkLatticeIter_DEFINED | 9 #define SkLatticeIter_DEFINED |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 static bool Valid(int imageWidth, int imageHeight, const SkIRect& center); | 29 static bool Valid(int imageWidth, int imageHeight, const SkIRect& center); |
30 | 30 |
31 SkLatticeIter(int imageWidth, int imageHeight, const SkIRect& center, const
SkRect& dst); | 31 SkLatticeIter(int imageWidth, int imageHeight, const SkIRect& center, const
SkRect& dst); |
32 | 32 |
33 /** | 33 /** |
34 * While it returns true, use src/dst to draw the image/bitmap | 34 * While it returns true, use src/dst to draw the image/bitmap |
35 */ | 35 */ |
36 bool next(SkRect* src, SkRect* dst); | 36 bool next(SkRect* src, SkRect* dst); |
37 | 37 |
| 38 /** |
| 39 * Returns the total number of rects that will be drawn. |
| 40 */ |
| 41 int numRects() const; |
| 42 |
38 private: | 43 private: |
39 SkTArray<SkScalar> fSrcX; | 44 SkTArray<SkScalar> fSrcX; |
40 SkTArray<SkScalar> fSrcY; | 45 SkTArray<SkScalar> fSrcY; |
41 SkTArray<SkScalar> fDstX; | 46 SkTArray<SkScalar> fDstX; |
42 SkTArray<SkScalar> fDstY; | 47 SkTArray<SkScalar> fDstY; |
43 | 48 |
44 int fCurrX; | 49 int fCurrX; |
45 int fCurrY; | 50 int fCurrY; |
46 bool fDone; | 51 bool fDone; |
47 }; | 52 }; |
48 | 53 |
49 #endif | 54 #endif |
OLD | NEW |