OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkPatchUtils_DEFINED | 8 #ifndef SkPatchUtils_DEFINED |
9 #define SkPatchUtils_DEFINED | 9 #define SkPatchUtils_DEFINED |
10 | 10 |
11 #include "SkPatch.h" | 11 #include "SkPatch.h" |
12 #include "SkMatrix.h" | 12 #include "SkMatrix.h" |
13 | 13 |
14 class SK_API SkPatchUtils { | 14 class SK_API SkPatchUtils { |
15 | 15 |
16 public: | 16 public: |
17 /** | 17 /** |
18 * Method that calculates a level of detail (number of subdivisions) for a p
atch in both axis. | 18 * Method that calculates a level of detail (number of subdivisions) for a p
atch in both axis. |
19 */ | 19 */ |
20 static SkISize GetLevelOfDetail(const SkPatch& patch, const SkMatrix* matrix
); | 20 static SkISize GetLevelOfDetail(const SkPoint cubics[12], const SkMatrix* ma
trix); |
| 21 static void getTopCubic(const SkPoint cubics[12], SkPoint points[4]); |
| 22 static void getBottomCubic(const SkPoint cubics[12], SkPoint points[4]); |
| 23 static void getLeftCubic(const SkPoint cubics[12], SkPoint points[4]); |
| 24 static void getRightCubic(const SkPoint cubics[12], SkPoint points[4]); |
| 25 static bool getVertexData(SkPatch::VertexData* data, const SkPoint cubics[12
], |
| 26 const SkColor colors[4], const SkPoint texCoords[4
], |
| 27 int lodX, int lodY); |
21 }; | 28 }; |
22 | 29 |
23 #endif | 30 #endif |
OLD | NEW |