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

Unified Diff: src/core/SkXfermode.cpp

Issue 766653008: Revert of 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: 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/effects/GrPorterDuffXferProcessor.h ('k') | src/effects/SkAlphaThresholdFilter.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 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
« no previous file with comments | « include/gpu/effects/GrPorterDuffXferProcessor.h ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698