Index: src/core/SkXfermode.cpp |
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp |
index 004aa93afd31576dad0c7e78d454fce7bae0e2a0..268d41ec1be3de741667adf3556dd5eda5075a57 100644 |
--- a/src/core/SkXfermode.cpp |
+++ b/src/core/SkXfermode.cpp |
@@ -689,19 +689,25 @@ |
bool SkXfermode::AsFragmentProcessorOrXPFactory(SkXfermode* xfermode, |
GrFragmentProcessor** fp, |
- GrXPFactory** xpf) { |
- Coeff src, dst; |
+ GrXPFactory** xpf, |
+ Coeff* src, Coeff* dst) { |
Mode mode; |
if (NULL == xfermode) { |
- *xpf = GrPorterDuffXPFactory::Create(kSrcOver_Mode); |
+ 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); |
+ } else if (xfermode->asCoeff(src, dst)) { |
+ *xpf = GrPorterDuffXPFactory::Create(*src, *dst); |
return true; |
} else if (xfermode->asXPFactory(xpf)) { |
+ *src = SkXfermode::kOne_Coeff; |
+ *dst = SkXfermode::kZero_Coeff; |
return true; |
} else { |
return xfermode->asFragmentProcessor(fp); |
@@ -710,7 +716,8 @@ |
#else |
bool SkXfermode::AsFragmentProcessorOrXPFactory(SkXfermode* xfermode, |
GrFragmentProcessor** fp, |
- GrXPFactory** xpf) { |
+ GrXPFactory** xpf, |
+ Coeff* src, Coeff* dst) { |
return false; |
} |
#endif |