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 "effects/GrPorterDuffXferProcessor.h" | 8 #include "effects/GrPorterDuffXferProcessor.h" |
9 | 9 |
10 #include "GrBlend.h" | 10 #include "GrBlend.h" |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 kRGBA_GrColorComponentFlags == knownColorFlags) { | 588 kRGBA_GrColorComponentFlags == knownColorFlags) { |
589 return true; | 589 return true; |
590 } | 590 } |
591 return false; | 591 return false; |
592 } | 592 } |
593 | 593 |
594 bool GrPorterDuffXPFactory::canTweakAlphaForCoverage() const { | 594 bool GrPorterDuffXPFactory::canTweakAlphaForCoverage() const { |
595 return can_tweak_alpha_for_coverage(fDstCoeff); | 595 return can_tweak_alpha_for_coverage(fDstCoeff); |
596 } | 596 } |
597 | 597 |
| 598 bool GrPorterDuffXPFactory::willBlendCoherently(const GrDrawTargetCaps& caps) co
nst { |
| 599 return true; |
| 600 } |
| 601 |
598 void GrPorterDuffXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, | 602 void GrPorterDuffXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI, |
599 const GrProcOptInfo& coveragePOI, | 603 const GrProcOptInfo& coveragePOI, |
600 GrXPFactory::InvariantOutput* out
put) const { | 604 GrXPFactory::InvariantOutput* out
put) const { |
601 if (!coveragePOI.isSolidWhite()) { | 605 if (!coveragePOI.isSolidWhite()) { |
602 output->fWillBlendWithDst = true; | 606 output->fWillBlendWithDst = true; |
603 output->fBlendedColorFlags = 0; | 607 output->fBlendedColorFlags = 0; |
604 return; | 608 return; |
605 } | 609 } |
606 | 610 |
607 GrBlendCoeff srcCoeff = fSrcCoeff; | 611 GrBlendCoeff srcCoeff = fSrcCoeff; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory); | 704 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory); |
701 | 705 |
702 GrXPFactory* GrPorterDuffXPFactory::TestCreate(SkRandom* random, | 706 GrXPFactory* GrPorterDuffXPFactory::TestCreate(SkRandom* random, |
703 GrContext*, | 707 GrContext*, |
704 const GrDrawTargetCaps&, | 708 const GrDrawTargetCaps&, |
705 GrTexture*[]) { | 709 GrTexture*[]) { |
706 SkXfermode::Mode mode = SkXfermode::Mode(random->nextULessThan(SkXfermode::k
LastCoeffMode)); | 710 SkXfermode::Mode mode = SkXfermode::Mode(random->nextULessThan(SkXfermode::k
LastCoeffMode)); |
707 return GrPorterDuffXPFactory::Create(mode); | 711 return GrPorterDuffXPFactory::Create(mode); |
708 } | 712 } |
709 | 713 |
OLD | NEW |