| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrRRectEffect.h" | 8 #include "GrRRectEffect.h" |
| 9 | 9 |
| 10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 typedef GrEffect INHERITED; | 75 typedef GrEffect INHERITED; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 GrEffectRef* CircularRRectEffect::Create(GrEffectEdgeType edgeType, | 78 GrEffectRef* CircularRRectEffect::Create(GrEffectEdgeType edgeType, |
| 79 uint32_t circularCornerFlags, | 79 uint32_t circularCornerFlags, |
| 80 const SkRRect& rrect) { | 80 const SkRRect& rrect) { |
| 81 if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType
!= edgeType) { | 81 if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType
!= edgeType) { |
| 82 return NULL; | 82 return NULL; |
| 83 } | 83 } |
| 84 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(CircularRRectEffect, | 84 return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect
)); |
| 85 (edgeType, circularCornerF
lags, rrect)))); | |
| 86 } | 85 } |
| 87 | 86 |
| 88 void CircularRRectEffect::getConstantColorComponents(GrColor* color, uint32_t* v
alidFlags) const { | 87 void CircularRRectEffect::getConstantColorComponents(GrColor* color, uint32_t* v
alidFlags) const { |
| 89 *validFlags = 0; | 88 *validFlags = 0; |
| 90 } | 89 } |
| 91 | 90 |
| 92 const GrBackendEffectFactory& CircularRRectEffect::getFactory() const { | 91 const GrBackendEffectFactory& CircularRRectEffect::getFactory() const { |
| 93 return GrTBackendEffectFactory<CircularRRectEffect>::getInstance(); | 92 return GrTBackendEffectFactory<CircularRRectEffect>::getInstance(); |
| 94 } | 93 } |
| 95 | 94 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 408 |
| 410 GR_DECLARE_EFFECT_TEST; | 409 GR_DECLARE_EFFECT_TEST; |
| 411 | 410 |
| 412 typedef GrEffect INHERITED; | 411 typedef GrEffect INHERITED; |
| 413 }; | 412 }; |
| 414 | 413 |
| 415 GrEffectRef* EllipticalRRectEffect::Create(GrEffectEdgeType edgeType, const SkRR
ect& rrect) { | 414 GrEffectRef* EllipticalRRectEffect::Create(GrEffectEdgeType edgeType, const SkRR
ect& rrect) { |
| 416 if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType
!= edgeType) { | 415 if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType
!= edgeType) { |
| 417 return NULL; | 416 return NULL; |
| 418 } | 417 } |
| 419 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(EllipticalRRectEffect, (ed
geType, rrect)))); | 418 return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)); |
| 420 } | 419 } |
| 421 | 420 |
| 422 void EllipticalRRectEffect::getConstantColorComponents(GrColor* color, uint32_t*
validFlags) const { | 421 void EllipticalRRectEffect::getConstantColorComponents(GrColor* color, uint32_t*
validFlags) const { |
| 423 *validFlags = 0; | 422 *validFlags = 0; |
| 424 } | 423 } |
| 425 | 424 |
| 426 const GrBackendEffectFactory& EllipticalRRectEffect::getFactory() const { | 425 const GrBackendEffectFactory& EllipticalRRectEffect::getFactory() const { |
| 427 return GrTBackendEffectFactory<EllipticalRRectEffect>::getInstance(); | 426 return GrTBackendEffectFactory<EllipticalRRectEffect>::getInstance(); |
| 428 } | 427 } |
| 429 | 428 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 if (rrect.isNinePatch()) { | 720 if (rrect.isNinePatch()) { |
| 722 return EllipticalRRectEffect::Create(edgeType, rrect); | 721 return EllipticalRRectEffect::Create(edgeType, rrect); |
| 723 } | 722 } |
| 724 return NULL; | 723 return NULL; |
| 725 } | 724 } |
| 726 } | 725 } |
| 727 } | 726 } |
| 728 | 727 |
| 729 return NULL; | 728 return NULL; |
| 730 } | 729 } |
| OLD | NEW |