| 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 "GrConvexPolyEffect.h" | 10 #include "GrConvexPolyEffect.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType, | 79 GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType, |
| 80 uint32_t circularCornerFlags, | 80 uint32_t circularCornerFlags, |
| 81 const SkRRect& rrect) { | 81 const SkRRect& rrect) { |
| 82 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { | 82 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { |
| 83 return NULL; | 83 return NULL; |
| 84 } | 84 } |
| 85 return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect
)); | 85 return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect
)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) con
st { | 88 void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) con
st { |
| 89 inout->mulByUnknownAlpha(); | 89 inout->mulByUnknownSingleComponent(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t
circularCornerFlags, | 92 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t
circularCornerFlags, |
| 93 const SkRRect& rrect) | 93 const SkRRect& rrect) |
| 94 : fRRect(rrect) | 94 : fRRect(rrect) |
| 95 , fEdgeType(edgeType) | 95 , fEdgeType(edgeType) |
| 96 , fCircularCornerFlags(circularCornerFlags) { | 96 , fCircularCornerFlags(circularCornerFlags) { |
| 97 this->initClassID<CircularRRectEffect>(); | 97 this->initClassID<CircularRRectEffect>(); |
| 98 this->setWillReadFragmentPosition(); | 98 this->setWillReadFragmentPosition(); |
| 99 } | 99 } |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 GrFragmentProcessor* | 420 GrFragmentProcessor* |
| 421 EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect
) { | 421 EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect
) { |
| 422 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { | 422 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { |
| 423 return NULL; | 423 return NULL; |
| 424 } | 424 } |
| 425 return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)); | 425 return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c
onst { | 428 void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c
onst { |
| 429 inout->mulByUnknownAlpha(); | 429 inout->mulByUnknownSingleComponent(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const
SkRRect& rrect) | 432 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const
SkRRect& rrect) |
| 433 : fRRect(rrect) | 433 : fRRect(rrect) |
| 434 , fEdgeType(edgeType) { | 434 , fEdgeType(edgeType) { |
| 435 this->initClassID<EllipticalRRectEffect>(); | 435 this->initClassID<EllipticalRRectEffect>(); |
| 436 this->setWillReadFragmentPosition(); | 436 this->setWillReadFragmentPosition(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 bool EllipticalRRectEffect::onIsEqual(const GrFragmentProcessor& other) const { | 439 bool EllipticalRRectEffect::onIsEqual(const GrFragmentProcessor& other) const { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 if (rrect.isNinePatch()) { | 733 if (rrect.isNinePatch()) { |
| 734 return EllipticalRRectEffect::Create(edgeType, rrect); | 734 return EllipticalRRectEffect::Create(edgeType, rrect); |
| 735 } | 735 } |
| 736 return NULL; | 736 return NULL; |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 | 740 |
| 741 return NULL; | 741 return NULL; |
| 742 } | 742 } |
| OLD | NEW |