Index: src/core/SkXfermode.cpp |
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp |
index ef44b1e747d927a2e5b22f87824e5dda44c88c76..83503659bd61098fe2140a6add8ff7c51c46085b 100644 |
--- a/src/core/SkXfermode.cpp |
+++ b/src/core/SkXfermode.cpp |
@@ -691,10 +691,17 @@ bool SkXfermode::AsFragmentProcessorOrXPFactory(SkXfermode* xfermode, |
GrFragmentProcessor** fp, |
GrXPFactory** xpf, |
Coeff* src, Coeff* dst) { |
+ Mode mode; |
if (NULL == xfermode) { |
SkAssertResult(ModeAsCoeff(kSrcOver_Mode, src, dst)); |
*xpf = GrPorterDuffXPFactory::Create(*src, *dst); |
return true; |
+ } else if (xfermode->asMode(&mode) && mode <= kLastCoeffMode) { |
+ *xpf = GrPorterDuffXPFactory::Create(mode); |
+ // TODO: This Line will be removed in follow up cl that handles blending and thus we won't |
+ // have to set coeffs here. |
+ SkAssertResult(ModeAsCoeff(mode, src, dst)); |
+ return true; |
} else if (xfermode->asCoeff(src, dst)) { |
*xpf = GrPorterDuffXPFactory::Create(*src, *dst); |
return true; |