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

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

Issue 678073005: Patch to remove constant attributes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | 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 79088137caa004519ddcd91d2ad13ad000f5ab40..4a274c6bb1e8806b98043328031b18d12df8ac16 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -257,25 +257,27 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fEmitsPointSize = GrGpu::kDrawPoints_DrawType == drawType;
- if (gpu->caps()->pathRenderingSupport() &&
- GrGpu::IsPathRenderingDrawType(drawType) &&
- gpu->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode) {
- header->fUseFragShaderOnly = true;
+ bool isPathRendering = GrGpu::IsPathRenderingDrawType(drawType);
+ if (gpu->caps()->pathRenderingSupport() && isPathRendering) {
+ header->fUseNvpr = true;
SkASSERT(!optState.hasGeometryProcessor());
} else {
- header->fUseFragShaderOnly = false;
+ header->fUseNvpr = false;
}
- bool defaultToUniformInputs = GrGpu::IsPathRenderingDrawType(drawType) ||
- GR_GL_NO_CONSTANT_ATTRIBUTES;
+ bool hasUniformColor = inputColorIsUsed &&
+ (isPathRendering || !optState.hasColorVertexAttribute());
+
+ bool hasUniformCoverage = inputCoverageIsUsed &&
+ (isPathRendering || !optState.hasCoverageVertexAttribute());
if (!inputColorIsUsed) {
header->fColorInput = kAllOnes_ColorInput;
- } else if (defaultToUniformInputs && !optState.hasColorVertexAttribute()) {
+ } else if (hasUniformColor) {
header->fColorInput = kUniform_ColorInput;
} else {
header->fColorInput = kAttribute_ColorInput;
- SkASSERT(!header->fUseFragShaderOnly);
+ SkASSERT(!header->fUseNvpr);
}
bool covIsSolidWhite = !optState.hasCoverageVertexAttribute() &&
@@ -283,11 +285,11 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
if (covIsSolidWhite || !inputCoverageIsUsed) {
header->fCoverageInput = kAllOnes_ColorInput;
- } else if (defaultToUniformInputs && !optState.hasCoverageVertexAttribute()) {
+ } else if (hasUniformCoverage) {
header->fCoverageInput = kUniform_ColorInput;
} else {
header->fCoverageInput = kAttribute_ColorInput;
- SkASSERT(!header->fUseFragShaderOnly);
+ SkASSERT(!header->fUseNvpr);
}
if (optState.readsDst()) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698