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

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

Issue 746423007: Draft change to start pulling uniform color into GP (Closed) Base URL: https://skia.googlesource.com/skia.git@no_factories
Patch Set: Created 6 years 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
« src/gpu/GrOptDrawState.cpp ('K') | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 6867a1329b048b59384dfded65f122eee414d05b..3cfe20c2b7f7bb89e831d072666cbfbac49a8b62 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -203,28 +203,33 @@ bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState,
header->fUseNvpr = false;
}
- bool hasUniformColor = inputColorIsUsed && (isPathRendering || !descInfo.fHasVertexColor);
+ if (!optState.newStyle()) {
+ bool hasUniformColor = inputColorIsUsed && (isPathRendering || !descInfo.fHasVertexColor);
- if (!inputColorIsUsed) {
- header->fColorInput = GrProgramDesc::kAllOnes_ColorInput;
- } else if (hasUniformColor) {
- header->fColorInput = GrProgramDesc::kUniform_ColorInput;
- } else {
- header->fColorInput = GrProgramDesc::kAttribute_ColorInput;
- SkASSERT(!header->fUseNvpr);
- }
+ if (!inputColorIsUsed) {
+ header->fColorInput = GrProgramDesc::kAllOnes_ColorInput;
+ } else if (hasUniformColor) {
+ header->fColorInput = GrProgramDesc::kUniform_ColorInput;
+ } else {
+ header->fColorInput = GrProgramDesc::kAttribute_ColorInput;
+ SkASSERT(!header->fUseNvpr);
+ }
- bool hasVertexCoverage = !isPathRendering && descInfo.fHasVertexCoverage;
+ bool hasVertexCoverage = !isPathRendering && descInfo.fHasVertexCoverage;
- bool covIsSolidWhite = !hasVertexCoverage && 0xffffffff == optState.getCoverageColor();
+ bool covIsSolidWhite = !hasVertexCoverage && 0xffffffff == optState.getCoverageColor();
- if (covIsSolidWhite || !inputCoverageIsUsed) {
- header->fCoverageInput = GrProgramDesc::kAllOnes_ColorInput;
- } else if (!hasVertexCoverage) {
- header->fCoverageInput = GrProgramDesc::kUniform_ColorInput;
+ if (covIsSolidWhite || !inputCoverageIsUsed) {
+ header->fCoverageInput = GrProgramDesc::kAllOnes_ColorInput;
+ } else if (!hasVertexCoverage) {
+ header->fCoverageInput = GrProgramDesc::kUniform_ColorInput;
+ } else {
+ header->fCoverageInput = GrProgramDesc::kAttribute_ColorInput;
+ SkASSERT(!header->fUseNvpr);
+ }
} else {
+ header->fColorInput = GrProgramDesc::kAttribute_ColorInput;
header->fCoverageInput = GrProgramDesc::kAttribute_ColorInput;
- SkASSERT(!header->fUseNvpr);
}
if (descInfo.fReadsDst) {
« src/gpu/GrOptDrawState.cpp ('K') | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698