| 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 GrPrimitiveProcessor_DEFINED | 8 #ifndef GrPrimitiveProcessor_DEFINED |
| 9 #define GrPrimitiveProcessor_DEFINED | 9 #define GrPrimitiveProcessor_DEFINED |
| 10 | 10 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 SkASSERT(index < fNumAttribs); | 213 SkASSERT(index < fNumAttribs); |
| 214 return fAttribs[index]; | 214 return fAttribs[index]; |
| 215 } | 215 } |
| 216 | 216 |
| 217 // Returns the vertex stride of the GP. A common use case is to request geo
metry from a | 217 // Returns the vertex stride of the GP. A common use case is to request geo
metry from a |
| 218 // drawtarget based off of the stride, and to populate this memory using an
implicit array of | 218 // drawtarget based off of the stride, and to populate this memory using an
implicit array of |
| 219 // structs. In this case, it is best to assert the vertexstride == sizeof(V
ertexStruct). | 219 // structs. In this case, it is best to assert the vertexstride == sizeof(V
ertexStruct). |
| 220 size_t getVertexStride() const { return fVertexStride; } | 220 size_t getVertexStride() const { return fVertexStride; } |
| 221 | 221 |
| 222 /** | 222 /** |
| 223 * Gets a transformKey from an array of coord transforms | 223 * Computes a transformKey from an array of coord transforms. Will only look
at the first |
| 224 * <numCoords> transforms in the array. |
| 225 * |
| 226 * TODO: A better name for this function would be "compute" instead of "get
". |
| 224 */ | 227 */ |
| 225 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>&) con
st; | 228 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>& coor
ds, |
| 229 int numCoords) const; |
| 226 | 230 |
| 227 /** | 231 /** |
| 228 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry | 232 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry |
| 229 * processor's GL backend implementation. | 233 * processor's GL backend implementation. |
| 234 * |
| 235 * TODO: A better name for this function would be "compute" instead of "get
". |
| 230 */ | 236 */ |
| 231 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 237 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
| 232 const GrGLSLCaps& caps, | 238 const GrGLSLCaps& caps, |
| 233 GrProcessorKeyBuilder* b) const = 0; | 239 GrProcessorKeyBuilder* b) const = 0; |
| 234 | 240 |
| 235 | 241 |
| 236 /** Returns a new instance of the appropriate *GL* implementation class | 242 /** Returns a new instance of the appropriate *GL* implementation class |
| 237 for the given GrProcessor; caller is responsible for deleting | 243 for the given GrProcessor; caller is responsible for deleting |
| 238 the object. */ | 244 the object. */ |
| 239 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 245 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 259 | 265 |
| 260 private: | 266 private: |
| 261 virtual bool hasExplicitLocalCoords() const = 0; | 267 virtual bool hasExplicitLocalCoords() const = 0; |
| 262 | 268 |
| 263 bool fIsPathRendering; | 269 bool fIsPathRendering; |
| 264 | 270 |
| 265 typedef GrProcessor INHERITED; | 271 typedef GrProcessor INHERITED; |
| 266 }; | 272 }; |
| 267 | 273 |
| 268 #endif | 274 #endif |
| OLD | NEW |