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 #ifndef SkMatrixUtils_DEFINED | 8 #ifndef SkMatrixUtils_DEFINED |
9 #define SkMatrixUtils_DEFINED | 9 #define SkMatrixUtils_DEFINED |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 /** | 34 /** |
35 * Calls SkTreatAsSprite() with default subpixelBits value to match Skia's | 35 * Calls SkTreatAsSprite() with default subpixelBits value to match Skia's |
36 * filter-bitmap implementation (i.e. kSkSubPixelBitsForBilerp). | 36 * filter-bitmap implementation (i.e. kSkSubPixelBitsForBilerp). |
37 */ | 37 */ |
38 static inline bool SkTreatAsSpriteFilter(const SkMatrix& matrix, | 38 static inline bool SkTreatAsSpriteFilter(const SkMatrix& matrix, |
39 int width, int height) { | 39 int width, int height) { |
40 return SkTreatAsSprite(matrix, width, height, kSkSubPixelBitsForBilerp); | 40 return SkTreatAsSprite(matrix, width, height, kSkSubPixelBitsForBilerp); |
41 } | 41 } |
42 | 42 |
43 /** Decomposes the upper-left 2x2 of the matrix into a rotation, followed by a n
on-uniform scale, | 43 /** Decomposes the upper-left 2x2 of the matrix into a rotation (represented by |
44 followed by another rotation. Returns true if successful. | 44 the cosine and sine of the rotation angle), followed by a non-uniform scale, |
45 If the scale factors are uniform, then rotation1 will be 0. | 45 followed by another rotation. If there is a reflection, one of the scale |
46 If there is a reflection, yScale will be negative. | 46 factors will be negative. |
47 Returns false if the matrix is degenerate. | 47 Returns true if successful. Returns false if the matrix is degenerate. |
48 */ | 48 */ |
49 bool SkDecomposeUpper2x2(const SkMatrix& matrix, | 49 bool SkDecomposeUpper2x2(const SkMatrix& matrix, |
50 SkScalar* rotation0, | 50 SkPoint* rotation1, |
51 SkScalar* xScale, SkScalar* yScale, | 51 SkPoint* scale, |
52 SkScalar* rotation1); | 52 SkPoint* rotation2); |
53 | 53 |
54 #endif | 54 #endif |
OLD | NEW |