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 #include "GrBezierEffect.h" | 8 #include "GrBezierEffect.h" |
9 | 9 |
10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 ////////////////////////////////////////////////////////////////////////////// | 123 ////////////////////////////////////////////////////////////////////////////// |
124 | 124 |
125 GrConicEffect::~GrConicEffect() {} | 125 GrConicEffect::~GrConicEffect() {} |
126 | 126 |
127 const GrBackendEffectFactory& GrConicEffect::getFactory() const { | 127 const GrBackendEffectFactory& GrConicEffect::getFactory() const { |
128 return GrTBackendEffectFactory<GrConicEffect>::getInstance(); | 128 return GrTBackendEffectFactory<GrConicEffect>::getInstance(); |
129 } | 129 } |
130 | 130 |
131 GrConicEffect::GrConicEffect(GrBezierEdgeType edgeType) : GrEffect() { | 131 GrConicEffect::GrConicEffect(GrBezierEdgeType edgeType) : GrVertexEffect() { |
132 this->addVertexAttrib(kVec4f_GrSLType); | 132 this->addVertexAttrib(kVec4f_GrSLType); |
133 fEdgeType = edgeType; | 133 fEdgeType = edgeType; |
134 } | 134 } |
135 | 135 |
136 bool GrConicEffect::onIsEqual(const GrEffect& other) const { | 136 bool GrConicEffect::onIsEqual(const GrEffect& other) const { |
137 const GrConicEffect& ce = CastEffect<GrConicEffect>(other); | 137 const GrConicEffect& ce = CastEffect<GrConicEffect>(other); |
138 return (ce.fEdgeType == fEdgeType); | 138 return (ce.fEdgeType == fEdgeType); |
139 } | 139 } |
140 | 140 |
141 ////////////////////////////////////////////////////////////////////////////// | 141 ////////////////////////////////////////////////////////////////////////////// |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 ////////////////////////////////////////////////////////////////////////////// | 255 ////////////////////////////////////////////////////////////////////////////// |
256 | 256 |
257 GrQuadEffect::~GrQuadEffect() {} | 257 GrQuadEffect::~GrQuadEffect() {} |
258 | 258 |
259 const GrBackendEffectFactory& GrQuadEffect::getFactory() const { | 259 const GrBackendEffectFactory& GrQuadEffect::getFactory() const { |
260 return GrTBackendEffectFactory<GrQuadEffect>::getInstance(); | 260 return GrTBackendEffectFactory<GrQuadEffect>::getInstance(); |
261 } | 261 } |
262 | 262 |
263 GrQuadEffect::GrQuadEffect(GrBezierEdgeType edgeType) : GrEffect() { | 263 GrQuadEffect::GrQuadEffect(GrBezierEdgeType edgeType) : GrVertexEffect() { |
264 this->addVertexAttrib(kVec4f_GrSLType); | 264 this->addVertexAttrib(kVec4f_GrSLType); |
265 fEdgeType = edgeType; | 265 fEdgeType = edgeType; |
266 } | 266 } |
267 | 267 |
268 bool GrQuadEffect::onIsEqual(const GrEffect& other) const { | 268 bool GrQuadEffect::onIsEqual(const GrEffect& other) const { |
269 const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other); | 269 const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other); |
270 return (ce.fEdgeType == fEdgeType); | 270 return (ce.fEdgeType == fEdgeType); |
271 } | 271 } |
272 | 272 |
273 ////////////////////////////////////////////////////////////////////////////// | 273 ////////////////////////////////////////////////////////////////////////////// |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 } | 396 } |
397 | 397 |
398 ////////////////////////////////////////////////////////////////////////////// | 398 ////////////////////////////////////////////////////////////////////////////// |
399 | 399 |
400 GrCubicEffect::~GrCubicEffect() {} | 400 GrCubicEffect::~GrCubicEffect() {} |
401 | 401 |
402 const GrBackendEffectFactory& GrCubicEffect::getFactory() const { | 402 const GrBackendEffectFactory& GrCubicEffect::getFactory() const { |
403 return GrTBackendEffectFactory<GrCubicEffect>::getInstance(); | 403 return GrTBackendEffectFactory<GrCubicEffect>::getInstance(); |
404 } | 404 } |
405 | 405 |
406 GrCubicEffect::GrCubicEffect(GrBezierEdgeType edgeType) : GrEffect() { | 406 GrCubicEffect::GrCubicEffect(GrBezierEdgeType edgeType) : GrVertexEffect() { |
407 this->addVertexAttrib(kVec4f_GrSLType); | 407 this->addVertexAttrib(kVec4f_GrSLType); |
408 fEdgeType = edgeType; | 408 fEdgeType = edgeType; |
409 } | 409 } |
410 | 410 |
411 bool GrCubicEffect::onIsEqual(const GrEffect& other) const { | 411 bool GrCubicEffect::onIsEqual(const GrEffect& other) const { |
412 const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other); | 412 const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other); |
413 return (ce.fEdgeType == fEdgeType); | 413 return (ce.fEdgeType == fEdgeType); |
414 } | 414 } |
415 | 415 |
416 ////////////////////////////////////////////////////////////////////////////// | 416 ////////////////////////////////////////////////////////////////////////////// |
417 | 417 |
418 GR_DEFINE_EFFECT_TEST(GrCubicEffect); | 418 GR_DEFINE_EFFECT_TEST(GrCubicEffect); |
419 | 419 |
420 GrEffectRef* GrCubicEffect::TestCreate(SkRandom* random, | 420 GrEffectRef* GrCubicEffect::TestCreate(SkRandom* random, |
421 GrContext*, | 421 GrContext*, |
422 const GrDrawTargetCaps& caps, | 422 const GrDrawTargetCaps& caps, |
423 GrTexture*[]) { | 423 GrTexture*[]) { |
424 const GrBezierEdgeType edgeType = static_cast<GrBezierEdgeType>(random->next
ULessThan(3)); | 424 const GrBezierEdgeType edgeType = static_cast<GrBezierEdgeType>(random->next
ULessThan(3)); |
425 return GrCubicEffect::Create(edgeType, caps); | 425 return GrCubicEffect::Create(edgeType, caps); |
426 } | 426 } |
OLD | NEW |