| 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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
| 9 #include "GrRRectEffect.h" | 9 #include "GrRRectEffect.h" |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType, | 80 GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType, |
| 81 uint32_t circularCornerFlags, | 81 uint32_t circularCornerFlags, |
| 82 const SkRRect& rrect) { | 82 const SkRRect& rrect) { |
| 83 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { | 83 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { |
| 84 return NULL; | 84 return NULL; |
| 85 } | 85 } |
| 86 return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect
)); | 86 return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect
)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void CircularRRectEffect::onComputeInvariantOutput(InvariantOutput* inout) const
{ | 89 void CircularRRectEffect::onComputeInvariantOutput(InvariantOutput* inout) const
{ |
| 90 inout->fValidFlags = 0; | 90 inout->mulByUnknownAlpha(); |
| 91 inout->fIsSingleComponent = false; | |
| 92 } | 91 } |
| 93 | 92 |
| 94 const GrBackendFragmentProcessorFactory& CircularRRectEffect::getFactory() const
{ | 93 const GrBackendFragmentProcessorFactory& CircularRRectEffect::getFactory() const
{ |
| 95 return GrTBackendFragmentProcessorFactory<CircularRRectEffect>::getInstance(
); | 94 return GrTBackendFragmentProcessorFactory<CircularRRectEffect>::getInstance(
); |
| 96 } | 95 } |
| 97 | 96 |
| 98 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t
circularCornerFlags, | 97 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t
circularCornerFlags, |
| 99 const SkRRect& rrect) | 98 const SkRRect& rrect) |
| 100 : fRRect(rrect) | 99 : fRRect(rrect) |
| 101 , fEdgeType(edgeType) | 100 , fEdgeType(edgeType) |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 418 |
| 420 GrFragmentProcessor* | 419 GrFragmentProcessor* |
| 421 EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect
) { | 420 EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect
) { |
| 422 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { | 421 if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdg
eType != edgeType) { |
| 423 return NULL; | 422 return NULL; |
| 424 } | 423 } |
| 425 return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)); | 424 return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)); |
| 426 } | 425 } |
| 427 | 426 |
| 428 void EllipticalRRectEffect::onComputeInvariantOutput(InvariantOutput* inout) con
st { | 427 void EllipticalRRectEffect::onComputeInvariantOutput(InvariantOutput* inout) con
st { |
| 429 inout->fValidFlags = 0; | 428 inout->mulByUnknownAlpha(); |
| 430 inout->fIsSingleComponent = false; | |
| 431 } | 429 } |
| 432 | 430 |
| 433 const GrBackendFragmentProcessorFactory& EllipticalRRectEffect::getFactory() con
st { | 431 const GrBackendFragmentProcessorFactory& EllipticalRRectEffect::getFactory() con
st { |
| 434 return GrTBackendFragmentProcessorFactory<EllipticalRRectEffect>::getInstanc
e(); | 432 return GrTBackendFragmentProcessorFactory<EllipticalRRectEffect>::getInstanc
e(); |
| 435 } | 433 } |
| 436 | 434 |
| 437 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const
SkRRect& rrect) | 435 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const
SkRRect& rrect) |
| 438 : fRRect(rrect) | 436 : fRRect(rrect) |
| 439 , fEdgeType(edgeType){ | 437 , fEdgeType(edgeType){ |
| 440 this->setWillReadFragmentPosition(); | 438 this->setWillReadFragmentPosition(); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 if (rrect.isNinePatch()) { | 728 if (rrect.isNinePatch()) { |
| 731 return EllipticalRRectEffect::Create(edgeType, rrect); | 729 return EllipticalRRectEffect::Create(edgeType, rrect); |
| 732 } | 730 } |
| 733 return NULL; | 731 return NULL; |
| 734 } | 732 } |
| 735 } | 733 } |
| 736 } | 734 } |
| 737 | 735 |
| 738 return NULL; | 736 return NULL; |
| 739 } | 737 } |
| OLD | NEW |