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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 25023003: Implement color filter as GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 91ac266093daf2742b0a2cad706bd501d3ba0a1d..586fc3b77599d8a42118e9142c71888bbde524e4 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -66,7 +66,8 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
bool colorIsTransBlack = SkToBool(blendOpts & GrDrawState::kEmitTransBlack_BlendOptFlag);
bool colorIsSolidWhite = (blendOpts & GrDrawState::kEmitCoverage_BlendOptFlag) ||
- (!requiresColorAttrib && 0xffffffff == drawState.getColor());
+ (!requiresColorAttrib && 0xffffffff == drawState.getColor()) ||
+ drawState.numColorStages() > 0 && !(*drawState.getColorStage(0)->getEffect())->getWillUseInputColor();
int numEffects = (skipColor ? 0 : drawState.numColorStages()) +
(skipCoverage ? 0 : drawState.numCoverageStages());
@@ -103,7 +104,6 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
}
header->fEmitsPointSize = isPoints;
- header->fColorFilterXfermode = skipColor ? SkXfermode::kDst_Mode : drawState.getColorFilterMode();
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything
// other than pass through values from the VS to the FS anyway).
@@ -191,9 +191,10 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
if (!drawState.isCoverageDrawing() && !skipCoverage &&
(drawState.numCoverageStages() > 0 || requiresCoverageAttrib)) {
// color filter is applied between color/coverage computation
- if (SkXfermode::kDst_Mode != header->fColorFilterXfermode) {
+ // TODO:
+ //if (SkXfermode::kDst_Mode != header->fColorFilterXfermode) {
separateCoverageFromColor = true;
- }
+ //}
// If we're stenciling then we want to discard samples that have zero coverage
if (drawState.getStencil().doesWrite()) {

Powered by Google App Engine
This is Rietveld 408576698