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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 if (covPOI.isFourChannelOutput()) { | 748 if (covPOI.isFourChannelOutput()) { |
749 return false; // The LCD XP will abort rather than doing a dst read. | 749 return false; // The LCD XP will abort rather than doing a dst read. |
750 } | 750 } |
751 // We fallback on the shader XP when the blend formula would use dual source
blending but we | 751 // We fallback on the shader XP when the blend formula would use dual source
blending but we |
752 // don't have support for it. | 752 // don't have support for it. |
753 return get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode).hasSe
condaryOutput(); | 753 return get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode).hasSe
condaryOutput(); |
754 } | 754 } |
755 | 755 |
756 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory); | 756 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory); |
757 | 757 |
758 GrXPFactory* GrPorterDuffXPFactory::TestCreate(GrProcessorTestData* d) { | 758 const GrXPFactory* GrPorterDuffXPFactory::TestCreate(GrProcessorTestData* d) { |
759 SkXfermode::Mode mode = SkXfermode::Mode(d->fRandom->nextULessThan(SkXfermod
e::kLastCoeffMode)); | 759 SkXfermode::Mode mode = SkXfermode::Mode(d->fRandom->nextULessThan(SkXfermod
e::kLastCoeffMode)); |
760 return GrPorterDuffXPFactory::Create(mode); | 760 return GrPorterDuffXPFactory::Create(mode); |
761 } | 761 } |
762 | 762 |
763 void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp, | 763 void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp, |
764 int* outPrimary, | 764 int* outPrimary, |
765 int* outSecondary) { | 765 int* outSecondary) { |
766 if (!!strcmp(xp->name(), "Porter Duff")) { | 766 if (!!strcmp(xp->name(), "Porter Duff")) { |
767 *outPrimary = *outSecondary = -1; | 767 *outPrimary = *outSecondary = -1; |
768 return; | 768 return; |
769 } | 769 } |
770 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)-
>getBlendFormula(); | 770 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)-
>getBlendFormula(); |
771 *outPrimary = blendFormula.fPrimaryOutputType; | 771 *outPrimary = blendFormula.fPrimaryOutputType; |
772 *outSecondary = blendFormula.fSecondaryOutputType; | 772 *outSecondary = blendFormula.fSecondaryOutputType; |
773 } | 773 } |
OLD | NEW |