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 | 213 |
214 | 214 |
215 /** Returns a new instance of the appropriate *GL* implementation class | 215 /** Returns a new instance of the appropriate *GL* implementation class |
216 for the given GrProcessor; caller is responsible for deleting | 216 for the given GrProcessor; caller is responsible for deleting |
217 the object. */ | 217 the object. */ |
218 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 218 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
219 const GrGLSLCaps& caps) con
st = 0; | 219 const GrGLSLCaps& caps) con
st = 0; |
220 | 220 |
221 bool isPathRendering() const { return fIsPathRendering; } | 221 bool isPathRendering() const { return fIsPathRendering; } |
222 | 222 |
| 223 /** |
| 224 * No Local Coord Transformation is needed in the shader, instead transforme
d local coords will |
| 225 * be provided via vertex attribute. |
| 226 */ |
| 227 virtual bool hasTransformedLocalCoords() const = 0; |
| 228 |
223 protected: | 229 protected: |
224 GrPrimitiveProcessor(bool isPathRendering) | 230 GrPrimitiveProcessor(bool isPathRendering) |
225 : fNumAttribs(0) | 231 : fNumAttribs(0) |
226 , fVertexStride(0) | 232 , fVertexStride(0) |
227 , fIsPathRendering(isPathRendering) {} | 233 , fIsPathRendering(isPathRendering) {} |
228 | 234 |
229 Attribute fAttribs[kMaxVertexAttribs]; | 235 Attribute fAttribs[kMaxVertexAttribs]; |
230 int fNumAttribs; | 236 int fNumAttribs; |
231 size_t fVertexStride; | 237 size_t fVertexStride; |
232 | 238 |
233 private: | 239 private: |
234 virtual bool hasExplicitLocalCoords() const = 0; | 240 virtual bool hasExplicitLocalCoords() const = 0; |
235 | 241 |
236 bool fIsPathRendering; | 242 bool fIsPathRendering; |
237 | 243 |
238 typedef GrProcessor INHERITED; | 244 typedef GrProcessor INHERITED; |
239 }; | 245 }; |
240 | 246 |
241 #endif | 247 #endif |
OLD | NEW |