OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 /** | 178 /** |
179 * Gets a pointer to a GrPoint of a vertex's position or texture | 179 * Gets a pointer to a GrPoint of a vertex's position or texture |
180 * coordinate. | 180 * coordinate. |
181 * @param vertices the vertex array | 181 * @param vertices the vertex array |
182 * @param vertexIndex the index of the vertex in the array | 182 * @param vertexIndex the index of the vertex in the array |
183 * @param vertexSize the size of each vertex in the array | 183 * @param vertexSize the size of each vertex in the array |
184 * @param offset the offset in bytes of the vertex component. | 184 * @param offset the offset in bytes of the vertex component. |
185 * Defaults to zero (corresponding to vertex position) | 185 * Defaults to zero (corresponding to vertex position) |
186 * @return pointer to the vertex component as a GrPoint | 186 * @return pointer to the vertex component as a GrPoint |
187 */ | 187 */ |
188 static GrPoint* GetVertexPoint(void* vertices, | 188 static SkPoint* GetVertexPoint(void* vertices, |
189 int vertexIndex, | 189 int vertexIndex, |
190 int vertexSize, | 190 int vertexSize, |
191 int offset = 0) { | 191 int offset = 0) { |
192 intptr_t start = GrTCast<intptr_t>(vertices); | 192 intptr_t start = GrTCast<intptr_t>(vertices); |
193 return GrTCast<GrPoint*>(start + offset + | 193 return GrTCast<SkPoint*>(start + offset + |
194 vertexIndex * vertexSize); | 194 vertexIndex * vertexSize); |
195 } | 195 } |
196 static const GrPoint* GetVertexPoint(const void* vertices, | 196 static const SkPoint* GetVertexPoint(const void* vertices, |
197 int vertexIndex, | 197 int vertexIndex, |
198 int vertexSize, | 198 int vertexSize, |
199 int offset = 0) { | 199 int offset = 0) { |
200 intptr_t start = GrTCast<intptr_t>(vertices); | 200 intptr_t start = GrTCast<intptr_t>(vertices); |
201 return GrTCast<const GrPoint*>(start + offset + | 201 return GrTCast<const SkPoint*>(start + offset + |
202 vertexIndex * vertexSize); | 202 vertexIndex * vertexSize); |
203 } | 203 } |
204 | 204 |
205 /** | 205 /** |
206 * Gets a pointer to a GrColor inside a vertex within a vertex array. | 206 * Gets a pointer to a GrColor inside a vertex within a vertex array. |
207 * @param vertices the vetex array | 207 * @param vertices the vetex array |
208 * @param vertexIndex the index of the vertex in the array | 208 * @param vertexIndex the index of the vertex in the array |
209 * @param vertexSize the size of each vertex in the array | 209 * @param vertexSize the size of each vertex in the array |
210 * @param offset the offset in bytes of the vertex color | 210 * @param offset the offset in bytes of the vertex color |
211 * @return pointer to the vertex component as a GrColor | 211 * @return pointer to the vertex component as a GrColor |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1053 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
1054 */ | 1054 */ |
1055 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1055 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1056 | 1056 |
1057 typedef SkRefCnt INHERITED; | 1057 typedef SkRefCnt INHERITED; |
1058 }; | 1058 }; |
1059 | 1059 |
1060 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1060 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1061 | 1061 |
1062 #endif | 1062 #endif |
OLD | NEW |