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 "GrDistanceFieldTextureEffect.h" | 8 #include "GrDistanceFieldTextureEffect.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 } | 652 } |
653 | 653 |
654 bool GrDistanceFieldLCDTextureEffect::onIsEqual(const GrGeometryProcessor& other
) const { | 654 bool GrDistanceFieldLCDTextureEffect::onIsEqual(const GrGeometryProcessor& other
) const { |
655 const GrDistanceFieldLCDTextureEffect& cte = other.cast<GrDistanceFieldLCDTe
xtureEffect>(); | 655 const GrDistanceFieldLCDTextureEffect& cte = other.cast<GrDistanceFieldLCDTe
xtureEffect>(); |
656 return (fTextColor == cte.fTextColor && | 656 return (fTextColor == cte.fTextColor && |
657 fFlags == cte.fFlags); | 657 fFlags == cte.fFlags); |
658 } | 658 } |
659 | 659 |
660 void GrDistanceFieldLCDTextureEffect::onComputeInvariantOutput(GrInvariantOutput
* inout) const { | 660 void GrDistanceFieldLCDTextureEffect::onComputeInvariantOutput(GrInvariantOutput
* inout) const { |
661 inout->mulByUnknownColor(); | 661 inout->mulByUnknownColor(); |
| 662 inout->setUsingLCDCoverage(); |
662 } | 663 } |
663 | 664 |
664 void GrDistanceFieldLCDTextureEffect::getGLProcessorKey(const GrBatchTracker& bt
, | 665 void GrDistanceFieldLCDTextureEffect::getGLProcessorKey(const GrBatchTracker& bt
, |
665 const GrGLCaps& caps, | 666 const GrGLCaps& caps, |
666 GrProcessorKeyBuilder* b
) const { | 667 GrProcessorKeyBuilder* b
) const { |
667 GrGLDistanceFieldLCDTextureEffect::GenKey(*this, bt, caps, b); | 668 GrGLDistanceFieldLCDTextureEffect::GenKey(*this, bt, caps, b); |
668 } | 669 } |
669 | 670 |
670 GrGLGeometryProcessor* | 671 GrGLGeometryProcessor* |
671 GrDistanceFieldLCDTextureEffect::createGLInstance(const GrBatchTracker& bt) cons
t { | 672 GrDistanceFieldLCDTextureEffect::createGLInstance(const GrBatchTracker& bt) cons
t { |
(...skipping 30 matching lines...) Expand all Loading... |
702 random->nextULessThan(256), | 703 random->nextULessThan(256), |
703 random->nextULessThan(256)); | 704 random->nextULessThan(256)); |
704 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; | 705 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; |
705 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; | 706 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; |
706 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; | 707 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; |
707 return GrDistanceFieldLCDTextureEffect::Create(textures[texIdx], params, | 708 return GrDistanceFieldLCDTextureEffect::Create(textures[texIdx], params, |
708 textures[texIdx2], params2, | 709 textures[texIdx2], params2, |
709 textColor, | 710 textColor, |
710 flags); | 711 flags); |
711 } | 712 } |
OLD | NEW |