| 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 SkPatchGrid_DEFINED | 8 #ifndef SkPatchGrid_DEFINED |
| 9 #define SkPatchGrid_DEFINED | 9 #define SkPatchGrid_DEFINED |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 public: | 81 public: |
| 82 | 82 |
| 83 enum VertexType { | 83 enum VertexType { |
| 84 kNone_VertexType = 0X00, | 84 kNone_VertexType = 0X00, |
| 85 kColors_VertexType = 0x01, | 85 kColors_VertexType = 0x01, |
| 86 kTexs_VertexType = 0x02, | 86 kTexs_VertexType = 0x02, |
| 87 kColorsAndTexs_VertexType = 0x03 | 87 kColorsAndTexs_VertexType = 0x03 |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 SkPatchGrid(int rows = 0, int cols = 0, VertexType flags = kNone_VertexType, | 90 SkPatchGrid(int rows = 0, int cols = 0, VertexType flags = kNone_VertexType, |
| 91 SkXfermode* xfer = NULL); | 91 SkXfermode* xfer = nullptr); |
| 92 | 92 |
| 93 ~SkPatchGrid(); | 93 ~SkPatchGrid(); |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Add a patch at location (x,y) overwriting the previous patch and shared p
oints so they | 96 * Add a patch at location (x,y) overwriting the previous patch and shared p
oints so they |
| 97 * mantain C0 connectivity. | 97 * mantain C0 connectivity. |
| 98 * The control points must be passed in a clockwise order starting at the to
p left corner. | 98 * The control points must be passed in a clockwise order starting at the to
p left corner. |
| 99 * The colors and texCoords are the values at the corners of the patch which
will be bilerp | 99 * The colors and texCoords are the values at the corners of the patch which
will be bilerp |
| 100 * across it, they must also be in counterclockwise order starting at the to
p left corner. | 100 * across it, they must also be in counterclockwise order starting at the to
p left corner. |
| 101 */ | 101 */ |
| 102 bool setPatch(int x, int y, const SkPoint cubics[12], const SkColor colors[4
], | 102 bool setPatch(int x, int y, const SkPoint cubics[12], const SkColor colors[4
], |
| 103 const SkPoint texCoords[4]); | 103 const SkPoint texCoords[4]); |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * Get patch at location (x,y). If cubics, colors or texCoords is not NULL i
t sets patch's | 106 * Get patch at location (x,y). If cubics, colors or texCoords is not nullpt
r it sets patch's |
| 107 * array with its corresponding values. | 107 * array with its corresponding values. |
| 108 * The function returns false if the cubics parameter is NULL or if the (x,y
) coordinates are | 108 * The function returns false if the cubics parameter is nullptr or if the (
x,y) coordinates are |
| 109 * not within the range of the grid. | 109 * not within the range of the grid. |
| 110 */ | 110 */ |
| 111 bool getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4], SkPoint t
exCoords[4]) const; | 111 bool getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4], SkPoint t
exCoords[4]) const; |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Resets the grid of patches to contain rows and cols of patches. | 114 * Resets the grid of patches to contain rows and cols of patches. |
| 115 */ | 115 */ |
| 116 void reset(int rows, int cols, VertexType flags, SkXfermode* xMode); | 116 void reset(int rows, int cols, VertexType flags, SkXfermode* xMode); |
| 117 | 117 |
| 118 /** | 118 /** |
| (...skipping 16 matching lines...) Expand all Loading... |
| 135 SkPoint* fCornerPts; | 135 SkPoint* fCornerPts; |
| 136 SkColor* fCornerColors; | 136 SkColor* fCornerColors; |
| 137 SkPoint* fTexCoords; | 137 SkPoint* fTexCoords; |
| 138 SkPoint* fHrzCtrlPts; | 138 SkPoint* fHrzCtrlPts; |
| 139 SkPoint* fVrtCtrlPts; | 139 SkPoint* fVrtCtrlPts; |
| 140 SkXfermode* fXferMode; | 140 SkXfermode* fXferMode; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 | 143 |
| 144 #endif | 144 #endif |
| OLD | NEW |