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

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: Fix a small thinko 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 8b731fbc2c71244e80a6f6dc87262280e31e214a..b53fa89fe9ccd2639e50e9c8f045c7beecf2b612 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -70,7 +70,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())->willUseInputColor());
int numEffects = (skipColor ? 0 : drawState.numColorStages()) +
(skipCoverage ? 0 : drawState.numCoverageStages());
@@ -111,7 +112,6 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
header->fHasVertexCode = hasVertexCode || requiresLocalCoordAttrib;
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).
@@ -200,11 +200,6 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
bool separateCoverageFromColor = false;
if (!drawState.isCoverageDrawing() && !skipCoverage &&
(drawState.numCoverageStages() > 0 || requiresCoverageAttrib)) {
- // color filter is applied between color/coverage computation
- 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()) {
header->fDiscardIfZeroCoverage = true;

Powered by Google App Engine
This is Rietveld 408576698