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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 */ | 183 */ |
184 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>& coor
ds, | 184 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>& coor
ds, |
185 int numCoords) const; | 185 int numCoords) const; |
186 | 186 |
187 /** | 187 /** |
188 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry | 188 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry |
189 * processor's GL backend implementation. | 189 * processor's GL backend implementation. |
190 * | 190 * |
191 * TODO: A better name for this function would be "compute" instead of "get
". | 191 * TODO: A better name for this function would be "compute" instead of "get
". |
192 */ | 192 */ |
193 virtual void getGLProcessorKey(const GrGLSLCaps& caps, | 193 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, |
194 GrProcessorKeyBuilder* b) const = 0; | 194 GrProcessorKeyBuilder* b) const = 0; |
195 | 195 |
196 | 196 |
197 /** Returns a new instance of the appropriate *GL* implementation class | 197 /** Returns a new instance of the appropriate *GL* implementation class |
198 for the given GrProcessor; caller is responsible for deleting | 198 for the given GrProcessor; caller is responsible for deleting |
199 the object. */ | 199 the object. */ |
200 virtual GrGLSLPrimitiveProcessor* createGLInstance(const GrGLSLCaps& caps) c
onst = 0; | 200 virtual GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps& caps)
const = 0; |
201 | 201 |
202 bool isPathRendering() const { return fIsPathRendering; } | 202 bool isPathRendering() const { return fIsPathRendering; } |
203 | 203 |
204 /** | 204 /** |
205 * No Local Coord Transformation is needed in the shader, instead transforme
d local coords will | 205 * No Local Coord Transformation is needed in the shader, instead transforme
d local coords will |
206 * be provided via vertex attribute. | 206 * be provided via vertex attribute. |
207 */ | 207 */ |
208 virtual bool hasTransformedLocalCoords() const = 0; | 208 virtual bool hasTransformedLocalCoords() const = 0; |
209 | 209 |
210 protected: | 210 protected: |
211 GrPrimitiveProcessor(bool isPathRendering) | 211 GrPrimitiveProcessor(bool isPathRendering) |
212 : fNumAttribs(0) | 212 : fNumAttribs(0) |
213 , fVertexStride(0) | 213 , fVertexStride(0) |
214 , fIsPathRendering(isPathRendering) {} | 214 , fIsPathRendering(isPathRendering) {} |
215 | 215 |
216 Attribute fAttribs[kMaxVertexAttribs]; | 216 Attribute fAttribs[kMaxVertexAttribs]; |
217 int fNumAttribs; | 217 int fNumAttribs; |
218 size_t fVertexStride; | 218 size_t fVertexStride; |
219 | 219 |
220 private: | 220 private: |
221 void notifyRefCntIsZero() const final {}; | 221 void notifyRefCntIsZero() const final {}; |
222 virtual bool hasExplicitLocalCoords() const = 0; | 222 virtual bool hasExplicitLocalCoords() const = 0; |
223 | 223 |
224 bool fIsPathRendering; | 224 bool fIsPathRendering; |
225 | 225 |
226 typedef GrProcessor INHERITED; | 226 typedef GrProcessor INHERITED; |
227 }; | 227 }; |
228 | 228 |
229 #endif | 229 #endif |
OLD | NEW |