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

Unified Diff: src/core/SkXfermode.cpp

Issue 1334293003: Create fragment processor for performing input color blend with child processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 5 years, 3 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 | « src/core/SkComposeShader.cpp ('k') | src/core/SkXfermode_proccoeff.h » ('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 8548fe8aaca251fcac622864270496a92516039d..3fb44b4d3bec31e98b082f174056668c369c26f3 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -651,8 +651,8 @@ bool SkXfermode::asMode(Mode* mode) const {
return false;
}
-bool SkXfermode::asFragmentProcessor(GrFragmentProcessor**, GrProcessorDataManager*,
- GrTexture*) const {
+bool SkXfermode::asFragmentProcessor(const GrFragmentProcessor**, GrProcessorDataManager*,
+ const GrFragmentProcessor*) const {
return false;
}
@@ -920,19 +920,18 @@ void SkProcCoeffXfermode::xferA8(SkAlpha* SK_RESTRICT dst,
#if SK_SUPPORT_GPU
#include "effects/GrCustomXfermode.h"
+#include "effects/GrXfermodeFragmentProcessor.h"
-bool SkProcCoeffXfermode::asFragmentProcessor(GrFragmentProcessor** fp,
+bool SkProcCoeffXfermode::asFragmentProcessor(const GrFragmentProcessor** fp,
GrProcessorDataManager* procDataManager,
- GrTexture* background) const {
- if (GrCustomXfermode::IsSupportedMode(fMode)) {
- if (fp) {
- SkASSERT(procDataManager);
- *fp = GrCustomXfermode::CreateFP(procDataManager, fMode, background);
- SkASSERT(*fp);
- }
- return true;
+ const GrFragmentProcessor* dst) const {
+ if (fp) {
+ SkASSERT(dst);
+ SkASSERT(procDataManager);
+ *fp = GrXfermodeFragmentProcessor::CreateFromDstProcessor(dst, fMode);
+ SkASSERT(*fp || kSrc_Mode == fMode);
}
- return false;
+ return true;
}
bool SkProcCoeffXfermode::asXPFactory(GrXPFactory** xp) const {
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkXfermode_proccoeff.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698