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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 617853003: Revert of Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/gpu/GrDrawState.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index 6a79203d1a0bcaded4bb6b0fd83387341f391e80..98a5689d534b72425a5df85f6409b64fd0f11dc6 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -170,19 +170,18 @@
int firstColorStage = 0;
// Set up color and flags for ConstantColorComponent checks
- GrProcessor::InvariantOutput inout;
- inout.fIsSingleComponent = false;
+ GrColor color;
+ uint32_t validComponentFlags;
if (!this->hasColorVertexAttribute()) {
- inout.fColor = ds.getColor();
- inout.fValidFlags = kRGBA_GrColorComponentFlags;
+ color = ds.getColor();
+ validComponentFlags = kRGBA_GrColorComponentFlags;
} else {
if (ds.vertexColorsAreOpaque()) {
- inout.fColor = 0xFF << GrColor_SHIFT_A;
- inout.fValidFlags = kA_GrColorComponentFlag;
+ color = 0xFF << GrColor_SHIFT_A;
+ validComponentFlags = kA_GrColorComponentFlag;
} else {
- inout.fValidFlags = 0;
- // not strictly necessary but we get false alarms from tools about uninit.
- inout.fColor = 0;
+ validComponentFlags = 0;
+ color = 0; // not strictly necessary but we get false alarms from tools about uninit.
}
}
@@ -192,10 +191,10 @@
firstColorStage = i;
fInputColorIsUsed = false;
}
- fp->computeInvariantOutput(&inout);
- if (kRGBA_GrColorComponentFlags == inout.fValidFlags) {
+ fp->getConstantColorComponents(&color, &validComponentFlags);
+ if (kRGBA_GrColorComponentFlags == validComponentFlags) {
firstColorStage = i + 1;
- fColor = inout.fColor;
+ fColor = color;
fInputColorIsUsed = true;
this->removeFixedFunctionVertexAttribs(0x1 << kColor_GrVertexAttribBinding);
}
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698