| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 bool GrConicEffect::onIsEqual(const GrEffect& other) const { | 137 bool GrConicEffect::onIsEqual(const GrEffect& other) const { |
| 138 const GrConicEffect& ce = CastEffect<GrConicEffect>(other); | 138 const GrConicEffect& ce = CastEffect<GrConicEffect>(other); |
| 139 return (ce.fEdgeType == fEdgeType); | 139 return (ce.fEdgeType == fEdgeType); |
| 140 } | 140 } |
| 141 | 141 |
| 142 ////////////////////////////////////////////////////////////////////////////// | 142 ////////////////////////////////////////////////////////////////////////////// |
| 143 | 143 |
| 144 GR_DEFINE_EFFECT_TEST(GrConicEffect); | 144 GR_DEFINE_EFFECT_TEST(GrConicEffect); |
| 145 | 145 |
| 146 GrEffectRef* GrConicEffect::TestCreate(SkRandom* random, | 146 GrEffect* GrConicEffect::TestCreate(SkRandom* random, |
| 147 GrContext*, | 147 GrContext*, |
| 148 const GrDrawTargetCaps& caps, | 148 const GrDrawTargetCaps& caps, |
| 149 GrTexture*[]) { | 149 GrTexture*[]) { |
| 150 GrEffectRef* effect; | 150 GrEffect* effect; |
| 151 do { | 151 do { |
| 152 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( | 152 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( |
| 153 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); | 153 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); |
| 154 effect = GrConicEffect::Create(edgeType, caps); | 154 effect = GrConicEffect::Create(edgeType, caps); |
| 155 } while (NULL == effect); | 155 } while (NULL == effect); |
| 156 return effect; | 156 return effect; |
| 157 } | 157 } |
| 158 | 158 |
| 159 ////////////////////////////////////////////////////////////////////////////// | 159 ////////////////////////////////////////////////////////////////////////////// |
| 160 // Quad | 160 // Quad |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 bool GrQuadEffect::onIsEqual(const GrEffect& other) const { | 275 bool GrQuadEffect::onIsEqual(const GrEffect& other) const { |
| 276 const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other); | 276 const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other); |
| 277 return (ce.fEdgeType == fEdgeType); | 277 return (ce.fEdgeType == fEdgeType); |
| 278 } | 278 } |
| 279 | 279 |
| 280 ////////////////////////////////////////////////////////////////////////////// | 280 ////////////////////////////////////////////////////////////////////////////// |
| 281 | 281 |
| 282 GR_DEFINE_EFFECT_TEST(GrQuadEffect); | 282 GR_DEFINE_EFFECT_TEST(GrQuadEffect); |
| 283 | 283 |
| 284 GrEffectRef* GrQuadEffect::TestCreate(SkRandom* random, | 284 GrEffect* GrQuadEffect::TestCreate(SkRandom* random, |
| 285 GrContext*, | 285 GrContext*, |
| 286 const GrDrawTargetCaps& caps, | 286 const GrDrawTargetCaps& caps, |
| 287 GrTexture*[]) { | 287 GrTexture*[]) { |
| 288 GrEffectRef* effect; | 288 GrEffect* effect; |
| 289 do { | 289 do { |
| 290 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( | 290 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( |
| 291 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); | 291 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); |
| 292 effect = GrQuadEffect::Create(edgeType, caps); | 292 effect = GrQuadEffect::Create(edgeType, caps); |
| 293 } while (NULL == effect); | 293 } while (NULL == effect); |
| 294 return effect; | 294 return effect; |
| 295 } | 295 } |
| 296 | 296 |
| 297 ////////////////////////////////////////////////////////////////////////////// | 297 ////////////////////////////////////////////////////////////////////////////// |
| 298 // Cubic | 298 // Cubic |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 bool GrCubicEffect::onIsEqual(const GrEffect& other) const { | 423 bool GrCubicEffect::onIsEqual(const GrEffect& other) const { |
| 424 const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other); | 424 const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other); |
| 425 return (ce.fEdgeType == fEdgeType); | 425 return (ce.fEdgeType == fEdgeType); |
| 426 } | 426 } |
| 427 | 427 |
| 428 ////////////////////////////////////////////////////////////////////////////// | 428 ////////////////////////////////////////////////////////////////////////////// |
| 429 | 429 |
| 430 GR_DEFINE_EFFECT_TEST(GrCubicEffect); | 430 GR_DEFINE_EFFECT_TEST(GrCubicEffect); |
| 431 | 431 |
| 432 GrEffectRef* GrCubicEffect::TestCreate(SkRandom* random, | 432 GrEffect* GrCubicEffect::TestCreate(SkRandom* random, |
| 433 GrContext*, | 433 GrContext*, |
| 434 const GrDrawTargetCaps& caps, | 434 const GrDrawTargetCaps& caps, |
| 435 GrTexture*[]) { | 435 GrTexture*[]) { |
| 436 GrEffectRef* effect; | 436 GrEffect* effect; |
| 437 do { | 437 do { |
| 438 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( | 438 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( |
| 439 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); | 439 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); |
| 440 effect = GrCubicEffect::Create(edgeType, caps); | 440 effect = GrCubicEffect::Create(edgeType, caps); |
| 441 } while (NULL == effect); | 441 } while (NULL == effect); |
| 442 return effect; | 442 return effect; |
| 443 } | 443 } |
| OLD | NEW |