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 * Apply a matrix to the dst points. | |
40 */ | |
41 void mapDstScaleTranslate(const SkMatrix& matrix); | |
42 | |
43 /** | |
44 * Returns the total number of rects that will be drawn. | |
45 */ | |
46 int numRects() const { | |
47 return fNumRects; | |
48 } | |
49 | |
50 private: | 38 private: |
51 SkTArray<SkScalar> fSrcX; | 39 SkTArray<SkScalar> fSrcX; |
52 SkTArray<SkScalar> fSrcY; | 40 SkTArray<SkScalar> fSrcY; |
53 SkTArray<SkScalar> fDstX; | 41 SkTArray<SkScalar> fDstX; |
54 SkTArray<SkScalar> fDstY; | 42 SkTArray<SkScalar> fDstY; |
55 | 43 |
56 int fCurrX; | 44 int fCurrX; |
57 int fCurrY; | 45 int fCurrY; |
58 bool fDone; | 46 bool fDone; |
59 int fNumRects; | |
60 }; | 47 }; |
61 | 48 |
62 #endif | 49 #endif |
OLD | NEW |