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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GrDrawTargetCaps& caps, |
65 const SkMatrix& localMatrix, | 65 const SkMatrix& localMatrix, |
66 uint8_t coverage = 0xff) { | 66 uint8_t coverage = 0xff) { |
67 switch (edgeType) { | 67 switch (edgeType) { |
68 case kFillAA_GrProcessorEdgeType: | 68 case kFillAA_GrProcessorEdgeType: |
69 if (!caps.shaderDerivativeSupport()) { | 69 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
70 return NULL; | 70 return NULL; |
71 } | 71 } |
72 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, | 72 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, |
73 kFillAA_GrProcessorEdgeType, | 73 kFillAA_GrProcessorEdgeType, |
74 localMatrix)); | 74 localMatrix)); |
75 case kHairlineAA_GrProcessorEdgeType: | 75 case kHairlineAA_GrProcessorEdgeType: |
76 if (!caps.shaderDerivativeSupport()) { | 76 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
77 return NULL; | 77 return NULL; |
78 } | 78 } |
79 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, | 79 return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage, |
80 kHairlineAA_GrProcessorEdgeTyp
e, | 80 kHairlineAA_GrProcessorEdgeTyp
e, |
81 localMatrix)); | 81 localMatrix)); |
82 case kFillBW_GrProcessorEdgeType: | 82 case kFillBW_GrProcessorEdgeType: |
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: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GrDrawTargetCaps& caps, |
150 const SkMatrix& localMatrix, | 150 const SkMatrix& localMatrix, |
151 uint8_t coverage = 0xff) { | 151 uint8_t coverage = 0xff) { |
152 switch (edgeType) { | 152 switch (edgeType) { |
153 case kFillAA_GrProcessorEdgeType: | 153 case kFillAA_GrProcessorEdgeType: |
154 if (!caps.shaderDerivativeSupport()) { | 154 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
155 return NULL; | 155 return NULL; |
156 } | 156 } |
157 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, | 157 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, |
158 kFillAA_GrProcessorEdgeType, | 158 kFillAA_GrProcessorEdgeType, |
159 localMatrix)); | 159 localMatrix)); |
160 case kHairlineAA_GrProcessorEdgeType: | 160 case kHairlineAA_GrProcessorEdgeType: |
161 if (!caps.shaderDerivativeSupport()) { | 161 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
162 return NULL; | 162 return NULL; |
163 } | 163 } |
164 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, | 164 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, |
165 kHairlineAA_GrProcessorEdgeType
, | 165 kHairlineAA_GrProcessorEdgeType
, |
166 localMatrix)); | 166 localMatrix)); |
167 case kFillBW_GrProcessorEdgeType: | 167 case kFillBW_GrProcessorEdgeType: |
168 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, | 168 return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage, |
169 kFillBW_GrProcessorEdgeType, | 169 kFillBW_GrProcessorEdgeType, |
170 localMatrix)); | 170 localMatrix)); |
171 default: | 171 default: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GrDrawTargetCaps& caps) { |
237 switch (edgeType) { | 237 switch (edgeType) { |
238 case kFillAA_GrProcessorEdgeType: | 238 case kFillAA_GrProcessorEdgeType: |
239 if (!caps.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.shaderDerivativeSupport()) { | 244 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
245 return NULL; | 245 return NULL; |
246 } | 246 } |
247 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, | 247 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, |
248 kHairlineAA_GrProcessorEdgeTyp
e)); | 248 kHairlineAA_GrProcessorEdgeTyp
e)); |
249 case kFillBW_GrProcessorEdgeType: | 249 case kFillBW_GrProcessorEdgeType: |
250 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, | 250 return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, |
251 kFillBW_GrProcessorEdgeType)); | 251 kFillBW_GrProcessorEdgeType)); |
252 default: | 252 default: |
253 return NULL; | 253 return NULL; |
254 } | 254 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 GrPrimitiveEdgeType fEdgeType; | 288 GrPrimitiveEdgeType fEdgeType; |
289 const Attribute* fInPosition; | 289 const Attribute* fInPosition; |
290 const Attribute* fInCubicCoeffs; | 290 const Attribute* fInCubicCoeffs; |
291 | 291 |
292 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 292 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
293 | 293 |
294 typedef GrGeometryProcessor INHERITED; | 294 typedef GrGeometryProcessor INHERITED; |
295 }; | 295 }; |
296 | 296 |
297 #endif | 297 #endif |
OLD | NEW |