Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: src/gpu/SkGr.cpp

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 9059f55c7af4b4630c53a85c2c9885f6dd15d8a0..82b1ce4b878b829218c5daaf0eac1531487deaf5 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -464,30 +464,21 @@ void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
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,
- &sm, &dm)) {
+ if (SkXfermode::AsFragmentProcessorOrXPFactory(mode, &fragmentProcessor, &xpFactory)) {
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);
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698