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

Unified Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 1471293003: Create a static instances of SrcOver XferProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 90ab030d2479807054f99caeda8710ccda2e70a5..262798267bb4877cbf1da5324b09d5cefa53b079 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -103,7 +103,7 @@ private:
const GrProcOptInfo& coveragePOI,
bool doesStencilWrite,
GrColor* overrideColor,
- const GrCaps& caps) override;
+ const GrCaps& caps) const override;
void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
@@ -132,7 +132,6 @@ public:
if (xp.hasHWBlendEquation()) {
SkASSERT(caps.advBlendEqInteraction() > 0); // 0 will mean !xp.hasHWBlendEquation().
key |= caps.advBlendEqInteraction();
- key |= xp.readsCoverage() << 2;
GR_STATIC_ASSERT(GrGLSLCaps::kLast_AdvBlendEqInteraction < 4);
}
if (!xp.hasHWBlendEquation() || caps.mustEnableSpecificAdvBlendEqs()) {
@@ -151,7 +150,7 @@ private:
// Apply coverage by multiplying it into the src color before blending. Mixed samples will
// "just work" automatically. (See onGetOptimizations())
- if (xp.readsCoverage()) {
+ if (args.fInputCoverage) {
fragBuilder->codeAppendf("%s = %s * %s;",
args.fOutputPrimary, args.fInputCoverage, args.fInputColor);
} else {
@@ -196,7 +195,7 @@ GrXferProcessor::OptFlags CustomXP::onGetOptimizations(const GrProcOptInfo& colo
const GrProcOptInfo& coveragePOI,
bool doesStencilWrite,
GrColor* overrideColor,
- const GrCaps& caps) {
+ const GrCaps& caps) const {
/*
Most the optimizations we do here are based on tweaking alpha for coverage.

Powered by Google App Engine
This is Rietveld 408576698