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 GrBezierEffect_DEFINED | 8 #ifndef GrBezierEffect_DEFINED |
9 #define GrBezierEffect_DEFINED | 9 #define GrBezierEffect_DEFINED |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, | 83 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, |
84 kFillBW_GrProcessorEdgeType, | 84 kFillBW_GrProcessorEdgeType, |
85 localMatrix)); | 85 localMatrix)); |
86 default: | 86 default: |
87 return NULL; | 87 return NULL; |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 virtual ~GrConicEffect(); | 91 virtual ~GrConicEffect(); |
92 | 92 |
93 virtual const char* name() const SK_OVERRIDE { return "Conic"; } | 93 const char* name() const SK_OVERRIDE { return "Conic"; } |
94 | 94 |
95 inline const GrAttribute* inPosition() const { return fInPosition; } | 95 inline const GrAttribute* inPosition() const { return fInPosition; } |
96 inline const GrAttribute* inConicCoeffs() const { return fInConicCoeffs; } | 96 inline const GrAttribute* inConicCoeffs() const { return fInConicCoeffs; } |
97 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 97 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
98 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} | 98 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} |
99 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } | 99 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
100 | 100 |
101 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 101 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
102 const GrGLCaps& caps, | 102 const GrGLCaps& caps, |
103 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 103 GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
104 | 104 |
105 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE; | 105 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE; |
106 | 106 |
107 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; | 107 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; |
108 bool onCanMakeEqual(const GrBatchTracker&, | 108 bool onCanMakeEqual(const GrBatchTracker&, |
109 const GrGeometryProcessor&, | 109 const GrGeometryProcessor&, |
110 const GrBatchTracker&) const SK_OVERRIDE; | 110 const GrBatchTracker&) const SK_OVERRIDE; |
111 | 111 |
112 private: | 112 private: |
113 GrConicEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimi
tiveEdgeType, | 113 GrConicEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimi
tiveEdgeType, |
114 const SkMatrix& localMatrix); | 114 const SkMatrix& localMatrix); |
115 | 115 |
116 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 116 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
117 | 117 |
118 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 118 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
119 out->setUnknownSingleComponent(); | 119 out->setUnknownSingleComponent(); |
120 } | 120 } |
121 | 121 |
122 uint8_t fCoverageScale; | 122 uint8_t fCoverageScale; |
123 GrPrimitiveEdgeType fEdgeType; | 123 GrPrimitiveEdgeType fEdgeType; |
124 const GrAttribute* fInPosition; | 124 const GrAttribute* fInPosition; |
125 const GrAttribute* fInConicCoeffs; | 125 const GrAttribute* fInConicCoeffs; |
126 | 126 |
127 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 127 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
128 | 128 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, | 167 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, |
168 kFillBW_GrProcessorEdgeType, | 168 kFillBW_GrProcessorEdgeType, |
169 localMatrix)); | 169 localMatrix)); |
170 default: | 170 default: |
171 return NULL; | 171 return NULL; |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 virtual ~GrQuadEffect(); | 175 virtual ~GrQuadEffect(); |
176 | 176 |
177 virtual const char* name() const SK_OVERRIDE { return "Quad"; } | 177 const char* name() const SK_OVERRIDE { return "Quad"; } |
178 | 178 |
179 inline const GrAttribute* inPosition() const { return fInPosition; } | 179 inline const GrAttribute* inPosition() const { return fInPosition; } |
180 inline const GrAttribute* inHairQuadEdge() const { return fInHairQuadEdge; } | 180 inline const GrAttribute* inHairQuadEdge() const { return fInHairQuadEdge; } |
181 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 181 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
182 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} | 182 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} |
183 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } | 183 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
184 | 184 |
185 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 185 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
186 const GrGLCaps& caps, | 186 const GrGLCaps& caps, |
187 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 187 GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
188 | 188 |
189 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE; | 189 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE; |
190 | 190 |
191 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; | 191 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; |
192 bool onCanMakeEqual(const GrBatchTracker&, | 192 bool onCanMakeEqual(const GrBatchTracker&, |
193 const GrGeometryProcessor&, | 193 const GrGeometryProcessor&, |
194 const GrBatchTracker&) const SK_OVERRIDE; | 194 const GrBatchTracker&) const SK_OVERRIDE; |
195 | 195 |
196 private: | 196 private: |
197 GrQuadEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimit
iveEdgeType, | 197 GrQuadEffect(GrColor, const SkMatrix& viewMatrix, uint8_t coverage, GrPrimit
iveEdgeType, |
198 const SkMatrix& localMatrix); | 198 const SkMatrix& localMatrix); |
199 | 199 |
200 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 200 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
201 | 201 |
202 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 202 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
203 out->setUnknownSingleComponent(); | 203 out->setUnknownSingleComponent(); |
204 } | 204 } |
205 | 205 |
206 uint8_t fCoverageScale; | 206 uint8_t fCoverageScale; |
207 GrPrimitiveEdgeType fEdgeType; | 207 GrPrimitiveEdgeType fEdgeType; |
208 const GrAttribute* fInPosition; | 208 const GrAttribute* fInPosition; |
209 const GrAttribute* fInHairQuadEdge; | 209 const GrAttribute* fInHairQuadEdge; |
210 | 210 |
211 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 211 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
212 | 212 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 case kFillBW_GrProcessorEdgeType: | 247 case kFillBW_GrProcessorEdgeType: |
248 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, | 248 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, |
249 kFillBW_GrProcessorEdgeType)); | 249 kFillBW_GrProcessorEdgeType)); |
250 default: | 250 default: |
251 return NULL; | 251 return NULL; |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 virtual ~GrCubicEffect(); | 255 virtual ~GrCubicEffect(); |
256 | 256 |
257 virtual const char* name() const SK_OVERRIDE { return "Cubic"; } | 257 const char* name() const SK_OVERRIDE { return "Cubic"; } |
258 | 258 |
259 inline const GrAttribute* inPosition() const { return fInPosition; } | 259 inline const GrAttribute* inPosition() const { return fInPosition; } |
260 inline const GrAttribute* inCubicCoeffs() const { return fInCubicCoeffs; } | 260 inline const GrAttribute* inCubicCoeffs() const { return fInCubicCoeffs; } |
261 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 261 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
262 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} | 262 inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType);
} |
263 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } | 263 inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
264 | 264 |
265 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 265 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
266 const GrGLCaps& caps, | 266 const GrGLCaps& caps, |
267 GrProcessorKeyBuilder* b) const SK_OVERRIDE; | 267 GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
268 | 268 |
269 virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) co
nst SK_OVERRIDE; | 269 GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_O
VERRIDE; |
270 | 270 |
271 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; | 271 void initBatchTracker(GrBatchTracker*, const InitBT&) const SK_OVERRIDE; |
272 bool onCanMakeEqual(const GrBatchTracker&, | 272 bool onCanMakeEqual(const GrBatchTracker&, |
273 const GrGeometryProcessor&, | 273 const GrGeometryProcessor&, |
274 const GrBatchTracker&) const SK_OVERRIDE; | 274 const GrBatchTracker&) const SK_OVERRIDE; |
275 | 275 |
276 private: | 276 private: |
277 GrCubicEffect(GrColor, const SkMatrix& viewMatrix, GrPrimitiveEdgeType); | 277 GrCubicEffect(GrColor, const SkMatrix& viewMatrix, GrPrimitiveEdgeType); |
278 | 278 |
279 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 279 bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
280 | 280 |
281 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 281 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERR
IDE { |
282 out->setUnknownSingleComponent(); | 282 out->setUnknownSingleComponent(); |
283 } | 283 } |
284 | 284 |
285 GrPrimitiveEdgeType fEdgeType; | 285 GrPrimitiveEdgeType fEdgeType; |
286 const GrAttribute* fInPosition; | 286 const GrAttribute* fInPosition; |
287 const GrAttribute* fInCubicCoeffs; | 287 const GrAttribute* fInCubicCoeffs; |
288 | 288 |
289 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 289 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
290 | 290 |
291 typedef GrGeometryProcessor INHERITED; | 291 typedef GrGeometryProcessor INHERITED; |
292 }; | 292 }; |
293 | 293 |
294 #endif | 294 #endif |
OLD | NEW |