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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.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/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index b5108a74d0fcfb7abe188e6d38575ba7b07f5370..0849d810debb5b6005c311e31a04d6376667a672 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -140,7 +140,8 @@ bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentProcessors(), inputColor);
this->emitAndInstallFragProcs(this->pipeline().numColorFragmentProcessors(), numProcs,
inputCoverage);
- this->emitAndInstallXferProc(*this->pipeline().getXferProcessor(), *inputColor, *inputCoverage);
+ this->emitAndInstallXferProc(*this->pipeline().getXferProcessor(), *inputColor, *inputCoverage,
+ this->pipeline().readsCoverage());
return true;
}
@@ -266,7 +267,8 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPrimitiveProcessor& gp,
void GrGLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
const GrGLSLExpr4& colorIn,
- const GrGLSLExpr4& coverageIn) {
+ const GrGLSLExpr4& coverageIn,
+ bool readsCoverage) {
// Program builders have a bit of state we need to clear with each effect
AutoStageAdvance adv(this);
@@ -295,7 +297,7 @@ void GrGLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
&fFS,
this->glslCaps(),
xp, colorIn.c_str(),
- coverageIn.c_str(),
+ readsCoverage ? coverageIn.c_str() : nullptr,
fFS.getPrimaryColorOutputName(),
fFS.getSecondaryColorOutputName(),
samplers);

Powered by Google App Engine
This is Rietveld 408576698