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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix isSolidWhite 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 98a5689d534b72425a5df85f6409b64fd0f11dc6..6a79203d1a0bcaded4bb6b0fd83387341f391e80 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -170,18 +170,19 @@ void GrOptDrawState::copyEffectiveColorStages(const GrDrawState& ds) {
int firstColorStage = 0;
// Set up color and flags for ConstantColorComponent checks
- GrColor color;
- uint32_t validComponentFlags;
+ GrProcessor::InvariantOutput inout;
+ inout.fIsSingleComponent = false;
if (!this->hasColorVertexAttribute()) {
- color = ds.getColor();
- validComponentFlags = kRGBA_GrColorComponentFlags;
+ inout.fColor = ds.getColor();
+ inout.fValidFlags = kRGBA_GrColorComponentFlags;
} else {
if (ds.vertexColorsAreOpaque()) {
- color = 0xFF << GrColor_SHIFT_A;
- validComponentFlags = kA_GrColorComponentFlag;
+ inout.fColor = 0xFF << GrColor_SHIFT_A;
+ inout.fValidFlags = kA_GrColorComponentFlag;
} else {
- validComponentFlags = 0;
- color = 0; // not strictly necessary but we get false alarms from tools about uninit.
+ inout.fValidFlags = 0;
+ // not strictly necessary but we get false alarms from tools about uninit.
+ inout.fColor = 0;
}
}
@@ -191,10 +192,10 @@ void GrOptDrawState::copyEffectiveColorStages(const GrDrawState& ds) {
firstColorStage = i;
fInputColorIsUsed = false;
}
- fp->getConstantColorComponents(&color, &validComponentFlags);
- if (kRGBA_GrColorComponentFlags == validComponentFlags) {
+ fp->computeInvariantOutput(&inout);
+ if (kRGBA_GrColorComponentFlags == inout.fValidFlags) {
firstColorStage = i + 1;
- fColor = color;
+ fColor = inout.fColor;
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