Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index 82b1ce4b878b829218c5daaf0eac1531487deaf5..9059f55c7af4b4630c53a85c2c9885f6dd15d8a0 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -464,21 +464,30 @@ |
grPaint->setDither(skPaint.isDither()); |
grPaint->setAntiAlias(skPaint.isAntiAlias()); |
+ SkXfermode::Coeff sm; |
+ SkXfermode::Coeff dm; |
+ |
SkXfermode* mode = skPaint.getXfermode(); |
GrFragmentProcessor* fragmentProcessor = NULL; |
GrXPFactory* xpFactory = NULL; |
- if (SkXfermode::AsFragmentProcessorOrXPFactory(mode, &fragmentProcessor, &xpFactory)) { |
+ if (SkXfermode::AsFragmentProcessorOrXPFactory(mode, &fragmentProcessor, &xpFactory, |
+ &sm, &dm)) { |
if (fragmentProcessor) { |
SkASSERT(NULL == xpFactory); |
grPaint->addColorProcessor(fragmentProcessor)->unref(); |
xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode); |
+ sm = SkXfermode::kOne_Coeff; |
+ dm = SkXfermode::kZero_Coeff; |
} |
} else { |
// Fall back to src-over |
xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode); |
+ sm = SkXfermode::kOne_Coeff; |
+ dm = SkXfermode::kISA_Coeff; |
} |
SkASSERT(xpFactory); |
grPaint->setXPFactory(xpFactory)->unref(); |
+ grPaint->setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm)); |
//set the color of the paint to the one of the parameter |
grPaint->setColor(paintColor); |