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

Unified Diff: src/core/SkXfermode.cpp

Issue 811903004: Do more cleanup from xp changes (Closed) Base URL: https://skia.googlesource.com/skia.git@removeReadDst
Patch Set: Remove virtual call Created 5 years, 11 months 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/core/SkXfermode.h ('k') | src/gpu/SkGr.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 37dbd0d1e24a264864873e2315b9e3e6b69dc19a..ac1ebcccb02c8e3530e3f062684acb5c04a000c5 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -687,30 +687,18 @@ bool SkXfermode::asXPFactory(GrXPFactory**) const {
#if SK_SUPPORT_GPU
#include "effects/GrPorterDuffXferProcessor.h"
-bool SkXfermode::AsFragmentProcessorOrXPFactory(SkXfermode* xfermode,
- GrFragmentProcessor** fp,
- GrXPFactory** xpf) {
- Coeff src, dst;
- Mode mode;
+bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) {
if (NULL == xfermode) {
- *xpf = GrPorterDuffXPFactory::Create(kSrcOver_Mode);
- return true;
- } else if (xfermode->asMode(&mode) && mode <= kLastCoeffMode) {
- *xpf = GrPorterDuffXPFactory::Create(mode);
- return true;
- } else if (xfermode->asCoeff(&src, &dst)) {
- *xpf = GrPorterDuffXPFactory::Create(src, dst);
- return true;
- } else if (xfermode->asXPFactory(xpf)) {
+ if (xpf) {
+ *xpf = GrPorterDuffXPFactory::Create(kSrcOver_Mode);
+ }
return true;
} else {
- return xfermode->asFragmentProcessor(fp, NULL);
+ return xfermode->asXPFactory(xpf);
}
}
#else
-bool SkXfermode::AsFragmentProcessorOrXPFactory(SkXfermode* xfermode,
- GrFragmentProcessor** fp,
- GrXPFactory** xpf) {
+bool SkXfermode::AsXPFactory(SkXfermode* xfermode, GrXPFactory** xpf) {
return false;
}
#endif
@@ -934,6 +922,14 @@ bool SkProcCoeffXfermode::asFragmentProcessor(GrFragmentProcessor** fp,
}
bool SkProcCoeffXfermode::asXPFactory(GrXPFactory** xp) const {
+ if (CANNOT_USE_COEFF != fSrcCoeff) {
+ if (xp) {
+ *xp = GrPorterDuffXPFactory::Create(fMode);
+ SkASSERT(*xp);
+ }
+ return true;
+ }
+
if (GrCustomXfermode::IsSupportedMode(fMode)) {
if (xp) {
*xp = GrCustomXfermode::CreateXPFactory(fMode);
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698