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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 VertexData() | 29 VertexData() |
30 : fVertexCount(0) | 30 : fVertexCount(0) |
31 , fIndexCount(0) | 31 , fIndexCount(0) |
32 , fPoints(NULL) | 32 , fPoints(NULL) |
33 , fTexCoords(NULL) | 33 , fTexCoords(NULL) |
34 , fColors(NULL) | 34 , fColors(NULL) |
35 , fIndices(NULL) { } | 35 , fIndices(NULL) { } |
36 | 36 |
37 ~VertexData() { | 37 ~VertexData() { |
38 SkDELETE_ARRAY(fPoints); | 38 delete[] fPoints; |
39 SkDELETE_ARRAY(fTexCoords); | 39 delete[] fTexCoords; |
40 SkDELETE_ARRAY(fColors); | 40 delete[] fColors; |
41 SkDELETE_ARRAY(fIndices); | 41 delete[] fIndices; |
42 } | 42 } |
43 }; | 43 }; |
44 | 44 |
45 // Enums for control points based on the order specified in the constructor
(clockwise). | 45 // Enums for control points based on the order specified in the constructor
(clockwise). |
46 enum CubicCtrlPts { | 46 enum CubicCtrlPts { |
47 kTopP0_CubicCtrlPts = 0, | 47 kTopP0_CubicCtrlPts = 0, |
48 kTopP1_CubicCtrlPts = 1, | 48 kTopP1_CubicCtrlPts = 1, |
49 kTopP2_CubicCtrlPts = 2, | 49 kTopP2_CubicCtrlPts = 2, |
50 kTopP3_CubicCtrlPts = 3, | 50 kTopP3_CubicCtrlPts = 3, |
51 | 51 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 * colors refers to the corner colors that will be bilerp across the patch (
optional parameter) | 112 * colors refers to the corner colors that will be bilerp across the patch (
optional parameter) |
113 * texCoords refers to the corner texture coordinates that will be bilerp ac
ross the patch | 113 * texCoords refers to the corner texture coordinates that will be bilerp ac
ross the patch |
114 (optional parameter) | 114 (optional parameter) |
115 */ | 115 */ |
116 static bool getVertexData(SkPatchUtils::VertexData* data, const SkPoint cubi
cs[12], | 116 static bool getVertexData(SkPatchUtils::VertexData* data, const SkPoint cubi
cs[12], |
117 const SkColor colors[4], const SkPoint texCoords[4
], | 117 const SkColor colors[4], const SkPoint texCoords[4
], |
118 int lodX, int lodY); | 118 int lodX, int lodY); |
119 }; | 119 }; |
120 | 120 |
121 #endif | 121 #endif |
OLD | NEW |