| Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp
|
| diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
|
| index 6f2b63f5cb2b53977041fef563d89e30be9ead65..cd3ef095b745458c5d1a2ad22cb0a77f4ce5bd42 100644
|
| --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
|
| +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
|
| @@ -266,15 +266,15 @@ void PorterDuffXferProcessor::calcOutputTypes(GrXferProcessor::OptFlags optFlags
|
| if (kZero_GrBlendCoeff == fDstBlend) {
|
| // write the coverage value to second color
|
| fSecondaryOutputType = kCoverage_SecondaryOutputType;
|
| - fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
|
| + fDstBlend = kIS2C_GrBlendCoeff;
|
| } else if (kSA_GrBlendCoeff == fDstBlend) {
|
| // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
|
| fSecondaryOutputType = kCoverageISA_SecondaryOutputType;
|
| - fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
|
| + fDstBlend = kIS2C_GrBlendCoeff;
|
| } else if (kSC_GrBlendCoeff == fDstBlend) {
|
| // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
|
| fSecondaryOutputType = kCoverageISC_SecondaryOutputType;
|
| - fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
|
| + fDstBlend = kIS2C_GrBlendCoeff;
|
| }
|
| }
|
| }
|
| @@ -594,19 +594,30 @@ bool GrPorterDuffXPFactory::willReadDstColor(const GrProcOptInfo& colorPOI,
|
|
|
| GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
|
|
|
| +
|
| +static bool blend_coeff_refs_src(SkXfermode::Coeff coeff) {
|
| + return (SkXfermode::kSC_Coeff == coeff || SkXfermode::kISC_Coeff == coeff ||
|
| + SkXfermode::kSA_Coeff == coeff || SkXfermode::kISA_Coeff == coeff);
|
| +}
|
| +
|
| +static bool blend_coeff_refs_dst(SkXfermode::Coeff coeff) {
|
| + return (SkXfermode::kDC_Coeff == coeff || SkXfermode::kIDC_Coeff == coeff ||
|
| + SkXfermode::kDA_Coeff == coeff || SkXfermode::kIDA_Coeff == coeff);
|
| +}
|
| +
|
| GrXPFactory* GrPorterDuffXPFactory::TestCreate(SkRandom* random,
|
| GrContext*,
|
| const GrDrawTargetCaps&,
|
| GrTexture*[]) {
|
| - GrBlendCoeff src;
|
| + SkXfermode::Coeff src;
|
| do {
|
| - src = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPublicGrBlendCoeff));
|
| - } while (GrBlendCoeffRefsSrc(src));
|
| + src = SkXfermode::Coeff(random->nextULessThan(SkXfermode::kCoeffCount));
|
| + } while (blend_coeff_refs_src(src));
|
|
|
| - GrBlendCoeff dst;
|
| + SkXfermode::Coeff dst;
|
| do {
|
| - dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPublicGrBlendCoeff));
|
| - } while (GrBlendCoeffRefsDst(dst));
|
| + dst = SkXfermode::Coeff(random->nextULessThan(SkXfermode::kCoeffCount));
|
| + } while (blend_coeff_refs_dst(dst));
|
|
|
| return GrPorterDuffXPFactory::Create(src, dst);
|
| }
|
|
|