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

Unified Diff: src/core/SkXfermode.cpp

Issue 776843004: Use static XPF for porter duff xp factories. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: Block case statements 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 | « include/gpu/GrXferProcessor.h ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698