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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GrCaps& 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 nullptr; |
72 } | 72 } |
73 return new GrConicEffect(color, viewMatrix, coverage, kFillAA_Gr
ProcessorEdgeType, | 73 return new GrConicEffect(color, viewMatrix, coverage, kFillAA_Gr
ProcessorEdgeType, |
74 localMatrix, usesLocalCoords); | 74 localMatrix, usesLocalCoords); |
75 case kHairlineAA_GrProcessorEdgeType: | 75 case kHairlineAA_GrProcessorEdgeType: |
76 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 76 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
77 return NULL; | 77 return nullptr; |
78 } | 78 } |
79 return new GrConicEffect(color, viewMatrix, coverage, | 79 return new GrConicEffect(color, viewMatrix, coverage, |
80 kHairlineAA_GrProcessorEdgeType, localM
atrix, | 80 kHairlineAA_GrProcessorEdgeType, localM
atrix, |
81 usesLocalCoords); | 81 usesLocalCoords); |
82 case kFillBW_GrProcessorEdgeType: | 82 case kFillBW_GrProcessorEdgeType: |
83 return new GrConicEffect(color, viewMatrix, coverage, kFillBW_Gr
ProcessorEdgeType, | 83 return new GrConicEffect(color, viewMatrix, coverage, kFillBW_Gr
ProcessorEdgeType, |
84 localMatrix, usesLocalCoords); | 84 localMatrix, usesLocalCoords); |
85 default: | 85 default: |
86 return NULL; | 86 return nullptr; |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 virtual ~GrConicEffect(); | 90 virtual ~GrConicEffect(); |
91 | 91 |
92 const char* name() const override { return "Conic"; } | 92 const char* name() const override { return "Conic"; } |
93 | 93 |
94 inline const Attribute* inPosition() const { return fInPosition; } | 94 inline const Attribute* inPosition() const { return fInPosition; } |
95 inline const Attribute* inConicCoeffs() const { return fInConicCoeffs; } | 95 inline const Attribute* inConicCoeffs() const { return fInConicCoeffs; } |
96 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 96 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 static GrGeometryProcessor* Create(GrColor color, | 144 static GrGeometryProcessor* Create(GrColor color, |
145 const SkMatrix& viewMatrix, | 145 const SkMatrix& viewMatrix, |
146 const GrPrimitiveEdgeType edgeType, | 146 const GrPrimitiveEdgeType edgeType, |
147 const GrCaps& caps, | 147 const GrCaps& caps, |
148 const SkMatrix& localMatrix, | 148 const SkMatrix& localMatrix, |
149 bool usesLocalCoords, | 149 bool usesLocalCoords, |
150 uint8_t coverage = 0xff) { | 150 uint8_t coverage = 0xff) { |
151 switch (edgeType) { | 151 switch (edgeType) { |
152 case kFillAA_GrProcessorEdgeType: | 152 case kFillAA_GrProcessorEdgeType: |
153 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 153 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
154 return NULL; | 154 return nullptr; |
155 } | 155 } |
156 return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrP
rocessorEdgeType, | 156 return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrP
rocessorEdgeType, |
157 localMatrix, usesLocalCoords); | 157 localMatrix, usesLocalCoords); |
158 case kHairlineAA_GrProcessorEdgeType: | 158 case kHairlineAA_GrProcessorEdgeType: |
159 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 159 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
160 return NULL; | 160 return nullptr; |
161 } | 161 } |
162 return new GrQuadEffect(color, viewMatrix, coverage, | 162 return new GrQuadEffect(color, viewMatrix, coverage, |
163 kHairlineAA_GrProcessorEdgeType, localMa
trix, | 163 kHairlineAA_GrProcessorEdgeType, localMa
trix, |
164 usesLocalCoords); | 164 usesLocalCoords); |
165 case kFillBW_GrProcessorEdgeType: | 165 case kFillBW_GrProcessorEdgeType: |
166 return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrP
rocessorEdgeType, | 166 return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrP
rocessorEdgeType, |
167 localMatrix, usesLocalCoords); | 167 localMatrix, usesLocalCoords); |
168 default: | 168 default: |
169 return NULL; | 169 return nullptr; |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 virtual ~GrQuadEffect(); | 173 virtual ~GrQuadEffect(); |
174 | 174 |
175 const char* name() const override { return "Quad"; } | 175 const char* name() const override { return "Quad"; } |
176 | 176 |
177 inline const Attribute* inPosition() const { return fInPosition; } | 177 inline const Attribute* inPosition() const { return fInPosition; } |
178 inline const Attribute* inHairQuadEdge() const { return fInHairQuadEdge; } | 178 inline const Attribute* inHairQuadEdge() const { return fInHairQuadEdge; } |
179 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 179 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 class GrCubicEffect : public GrGeometryProcessor { | 227 class GrCubicEffect : public GrGeometryProcessor { |
228 public: | 228 public: |
229 static GrGeometryProcessor* Create(GrColor color, | 229 static GrGeometryProcessor* Create(GrColor color, |
230 const SkMatrix& viewMatrix, | 230 const SkMatrix& viewMatrix, |
231 const GrPrimitiveEdgeType edgeType, | 231 const GrPrimitiveEdgeType edgeType, |
232 const GrCaps& caps) { | 232 const GrCaps& caps) { |
233 switch (edgeType) { | 233 switch (edgeType) { |
234 case kFillAA_GrProcessorEdgeType: | 234 case kFillAA_GrProcessorEdgeType: |
235 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 235 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
236 return NULL; | 236 return nullptr; |
237 } | 237 } |
238 return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorE
dgeType); | 238 return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorE
dgeType); |
239 case kHairlineAA_GrProcessorEdgeType: | 239 case kHairlineAA_GrProcessorEdgeType: |
240 if (!caps.shaderCaps()->shaderDerivativeSupport()) { | 240 if (!caps.shaderCaps()->shaderDerivativeSupport()) { |
241 return NULL; | 241 return nullptr; |
242 } | 242 } |
243 return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProces
sorEdgeType); | 243 return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProces
sorEdgeType); |
244 case kFillBW_GrProcessorEdgeType: | 244 case kFillBW_GrProcessorEdgeType: |
245 return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorE
dgeType); | 245 return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorE
dgeType); |
246 default: | 246 default: |
247 return NULL; | 247 return nullptr; |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 virtual ~GrCubicEffect(); | 251 virtual ~GrCubicEffect(); |
252 | 252 |
253 const char* name() const override { return "Cubic"; } | 253 const char* name() const override { return "Cubic"; } |
254 | 254 |
255 inline const Attribute* inPosition() const { return fInPosition; } | 255 inline const Attribute* inPosition() const { return fInPosition; } |
256 inline const Attribute* inCubicCoeffs() const { return fInCubicCoeffs; } | 256 inline const Attribute* inCubicCoeffs() const { return fInCubicCoeffs; } |
257 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } | 257 inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType
); } |
(...skipping 18 matching lines...) Expand all Loading... |
276 GrPrimitiveEdgeType fEdgeType; | 276 GrPrimitiveEdgeType fEdgeType; |
277 const Attribute* fInPosition; | 277 const Attribute* fInPosition; |
278 const Attribute* fInCubicCoeffs; | 278 const Attribute* fInCubicCoeffs; |
279 | 279 |
280 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 280 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
281 | 281 |
282 typedef GrGeometryProcessor INHERITED; | 282 typedef GrGeometryProcessor INHERITED; |
283 }; | 283 }; |
284 | 284 |
285 #endif | 285 #endif |
OLD | NEW |