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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 static const size_t kMaxSize = 32; | 63 static const size_t kMaxSize = 32; |
64 | 64 |
65 private: | 65 private: |
66 SkAlignedSStorage<kMaxSize> fData; | 66 SkAlignedSStorage<kMaxSize> fData; |
67 }; | 67 }; |
68 | 68 |
69 class GrIndexBufferAllocPool; | 69 class GrIndexBufferAllocPool; |
70 class GrGLCaps; | 70 class GrGLCaps; |
| 71 typedef GrGLCaps GrGLSLCaps; |
71 class GrGLPrimitiveProcessor; | 72 class GrGLPrimitiveProcessor; |
72 class GrVertexBufferAllocPool; | 73 class GrVertexBufferAllocPool; |
73 | 74 |
74 struct GrInitInvariantOutput; | 75 struct GrInitInvariantOutput; |
75 | 76 |
76 /* | 77 /* |
77 * This struct allows the GrPipeline to communicate information about the pipeli
ne. Most of this | 78 * This struct allows the GrPipeline to communicate information about the pipeli
ne. Most of this |
78 * is overrides, but some of it is general information. Logically it should liv
e in GrPipeline.h, | 79 * is overrides, but some of it is general information. Logically it should liv
e in GrPipeline.h, |
79 * but this is problematic due to circular dependencies. | 80 * but this is problematic due to circular dependencies. |
80 */ | 81 */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 /** | 157 /** |
157 * Gets a transformKey from an array of coord transforms | 158 * Gets a transformKey from an array of coord transforms |
158 */ | 159 */ |
159 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>&) con
st; | 160 uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>&) con
st; |
160 | 161 |
161 /** | 162 /** |
162 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry | 163 * Sets a unique key on the GrProcessorKeyBuilder that is directly associate
d with this geometry |
163 * processor's GL backend implementation. | 164 * processor's GL backend implementation. |
164 */ | 165 */ |
165 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 166 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
166 const GrGLCaps& caps, | 167 const GrGLSLCaps& caps, |
167 GrProcessorKeyBuilder* b) const = 0; | 168 GrProcessorKeyBuilder* b) const = 0; |
168 | 169 |
169 | 170 |
170 /** Returns a new instance of the appropriate *GL* implementation class | 171 /** Returns a new instance of the appropriate *GL* implementation class |
171 for the given GrProcessor; caller is responsible for deleting | 172 for the given GrProcessor; caller is responsible for deleting |
172 the object. */ | 173 the object. */ |
173 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 174 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
174 const GrGLCaps& caps) const
= 0; | 175 const GrGLSLCaps& caps) con
st = 0; |
175 | 176 |
176 bool isPathRendering() const { return fIsPathRendering; } | 177 bool isPathRendering() const { return fIsPathRendering; } |
177 | 178 |
178 protected: | 179 protected: |
179 GrPrimitiveProcessor(const SkMatrix& viewMatrix, const SkMatrix& localMatrix
, | 180 GrPrimitiveProcessor(const SkMatrix& viewMatrix, const SkMatrix& localMatrix
, |
180 bool isPathRendering) | 181 bool isPathRendering) |
181 : fNumAttribs(0) | 182 : fNumAttribs(0) |
182 , fVertexStride(0) | 183 , fVertexStride(0) |
183 , fViewMatrix(viewMatrix) | 184 , fViewMatrix(viewMatrix) |
184 , fLocalMatrix(localMatrix) | 185 , fLocalMatrix(localMatrix) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 virtual bool hasExplicitLocalCoords() const = 0; | 223 virtual bool hasExplicitLocalCoords() const = 0; |
223 | 224 |
224 const SkMatrix fViewMatrix; | 225 const SkMatrix fViewMatrix; |
225 SkMatrix fLocalMatrix; | 226 SkMatrix fLocalMatrix; |
226 bool fIsPathRendering; | 227 bool fIsPathRendering; |
227 | 228 |
228 typedef GrProcessor INHERITED; | 229 typedef GrProcessor INHERITED; |
229 }; | 230 }; |
230 | 231 |
231 #endif | 232 #endif |
OLD | NEW |