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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 * only one geometry would need to be rendered. However no benches were run comp
aring | 54 * only one geometry would need to be rendered. However no benches were run comp
aring |
55 * chopped first order and non chopped 2nd order. | 55 * chopped first order and non chopped 2nd order. |
56 */ | 56 */ |
57 class GrGLConicEffect; | 57 class GrGLConicEffect; |
58 | 58 |
59 class GrConicEffect : public GrGeometryProcessor { | 59 class GrConicEffect : public GrGeometryProcessor { |
60 public: | 60 public: |
61 static GrGeometryProcessor* Create(GrColor color, | 61 static GrGeometryProcessor* Create(GrColor color, |
62 const SkMatrix& viewMatrix, | 62 const SkMatrix& viewMatrix, |
63 const GrPrimitiveEdgeType edgeType, | 63 const GrPrimitiveEdgeType edgeType, |
64 const GrDrawTargetCaps& caps, | 64 const GrCaps& caps, |
65 const SkMatrix& localMatrix, | 65 const SkMatrix& localMatrix, |
66 bool usesLocalCoords, | 66 bool usesLocalCoords, |
67 uint8_t coverage = 0xff) { | 67 uint8_t coverage = 0xff) { |
68 switch (edgeType) { | 68 switch (edgeType) { |
69 case kFillAA_GrProcessorEdgeType: | 69 case kFillAA_GrProcessorEdgeType: |
70 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 70 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
71 return NULL; | 71 return NULL; |
72 } | 72 } |
73 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, | 73 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, |
74 kFillAA_GrProcessorEdgeType, | 74 kFillAA_GrProcessorEdgeType, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 * Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused. | 139 * Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused. |
140 * Requires shader derivative instruction support. | 140 * Requires shader derivative instruction support. |
141 */ | 141 */ |
142 class GrGLQuadEffect; | 142 class GrGLQuadEffect; |
143 | 143 |
144 class GrQuadEffect : public GrGeometryProcessor { | 144 class GrQuadEffect : public GrGeometryProcessor { |
145 public: | 145 public: |
146 static GrGeometryProcessor* Create(GrColor color, | 146 static GrGeometryProcessor* Create(GrColor color, |
147 const SkMatrix& viewMatrix, | 147 const SkMatrix& viewMatrix, |
148 const GrPrimitiveEdgeType edgeType, | 148 const GrPrimitiveEdgeType edgeType, |
149 const GrDrawTargetCaps& caps, | 149 const GrCaps& caps, |
150 const SkMatrix& localMatrix, | 150 const SkMatrix& localMatrix, |
151 bool usesLocalCoords, | 151 bool usesLocalCoords, |
152 uint8_t coverage = 0xff) { | 152 uint8_t coverage = 0xff) { |
153 switch (edgeType) { | 153 switch (edgeType) { |
154 case kFillAA_GrProcessorEdgeType: | 154 case kFillAA_GrProcessorEdgeType: |
155 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 155 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
156 return NULL; | 156 return NULL; |
157 } | 157 } |
158 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, | 158 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, |
159 kFillAA_GrProcessorEdgeType, | 159 kFillAA_GrProcessorEdgeType, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 * first order approximation from the taylor series. | 226 * first order approximation from the taylor series. |
227 * Coverage for AA is max(0, 1-distance). | 227 * Coverage for AA is max(0, 1-distance). |
228 */ | 228 */ |
229 class GrGLCubicEffect; | 229 class GrGLCubicEffect; |
230 | 230 |
231 class GrCubicEffect : public GrGeometryProcessor { | 231 class GrCubicEffect : public GrGeometryProcessor { |
232 public: | 232 public: |
233 static GrGeometryProcessor* Create(GrColor color, | 233 static GrGeometryProcessor* Create(GrColor color, |
234 const SkMatrix& viewMatrix, | 234 const SkMatrix& viewMatrix, |
235 const GrPrimitiveEdgeType edgeType, | 235 const GrPrimitiveEdgeType edgeType, |
236 const GrDrawTargetCaps& caps) { | 236 const GrCaps& caps) { |
237 switch (edgeType) { | 237 switch (edgeType) { |
238 case kFillAA_GrProcessorEdgeType: | 238 case kFillAA_GrProcessorEdgeType: |
239 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 239 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
240 return NULL; | 240 return NULL; |
241 } | 241 } |
242 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, kFillAA_GrP
rocessorEdgeType)); | 242 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, kFillAA_GrP
rocessorEdgeType)); |
243 case kHairlineAA_GrProcessorEdgeType: | 243 case kHairlineAA_GrProcessorEdgeType: |
244 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 244 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
245 return NULL; | 245 return NULL; |
246 } | 246 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 GrPrimitiveEdgeType fEdgeType; | 282 GrPrimitiveEdgeType fEdgeType; |
283 const Attribute* fInPosition; | 283 const Attribute* fInPosition; |
284 const Attribute* fInCubicCoeffs; | 284 const Attribute* fInCubicCoeffs; |
285 | 285 |
286 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 286 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
287 | 287 |
288 typedef GrGeometryProcessor INHERITED; | 288 typedef GrGeometryProcessor INHERITED; |
289 }; | 289 }; |
290 | 290 |
291 #endif | 291 #endif |
OLD | NEW |