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

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: cleanup 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
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 2476c5532cc3cd89cc14af1c7ccdf4e53ccc6112..936f0757e6f8427e404f90bac6669c985836eee1 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -158,9 +158,6 @@ bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState,
GrGpu::DrawType drawType,
GrGpuGL* gpu,
GrProgramDesc* desc) {
- bool inputColorIsUsed = descInfo.fInputColorIsUsed;
- bool inputCoverageIsUsed = descInfo.fInputCoverageIsUsed;
-
// The descriptor is used as a cache key. Thus when a field of the
// descriptor will not affect program generation (because of the attribute
// bindings in use or other descriptor field settings) it should be set
@@ -212,8 +209,6 @@ bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState,
// make sure any padding in the header is zeroed.
memset(header, 0, kHeaderSize);
- header->fHasGeometryProcessor = optState.hasGeometryProcessor();
-
bool isPathRendering = GrGpu::IsPathRenderingDrawType(drawType);
if (gpu->caps()->pathRenderingSupport() && isPathRendering) {
header->fUseNvpr = true;
@@ -222,30 +217,6 @@ bool GrGLProgramDescBuilder::Build(const GrOptDrawState& optState,
header->fUseNvpr = false;
}
- 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);
- }
-
- bool hasVertexCoverage = !isPathRendering && descInfo.fHasVertexCoverage;
-
- bool covIsSolidWhite = !hasVertexCoverage && 0xffffffff == optState.getCoverageColor();
-
- 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);
- }
-
if (descInfo.fReadsDst) {
const GrDeviceCoordTexture* dstCopy = optState.getDstCopy();
SkASSERT(dstCopy || gpu->caps()->dstReadInShaderSupport());

Powered by Google App Engine
This is Rietveld 408576698