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

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

Issue 586793002: Change GrGLProgramDesc header to have DoPathRendering flag instead of RequiresVertexShader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cast to bool Created 6 years, 3 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/builders/GrGLFragmentOnlyProgramBuilder.cpp » ('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 c6560be2b257e91991d1dffd106a7a2fdcd46f38..c0a9e13ed19ca4eddf30e6cd283886dc82da5ab0 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -163,7 +163,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
GrGpu::DrawType drawType,
GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff,
- const GrGpuGL* gpu,
+ GrGpuGL* gpu,
const GrDeviceCoordTexture* dstCopy,
const GrEffectStage** geometryProcessor,
SkTArray<const GrEffectStage*, true>* colorStages,
@@ -260,12 +260,11 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
// Because header is a pointer into the dynamic array, we can't push any new data into the key
// below here.
- // We will only require a vertex shader if we have more than just the position VA attrib.
- // If we have a geom processor we must us a vertex shader and we should not have a geometry
- // processor if we are doing path rendering.
- SkASSERT(!GrGpu::IsPathRenderingDrawType(drawType) || !optState.requiresVertexShader());
- header->fRequiresVertexShader = optState.requiresVertexShader() ||
- !GrGpu::IsPathRenderingDrawType(drawType);
+ header->fUseFragShaderOnly = gpu->caps()->pathRenderingSupport() &&
+ GrGpu::IsPathRenderingDrawType(drawType) &&
+ gpu->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode;
+ SkASSERT(!header->fUseFragShaderOnly || !optState.hasGeometryProcessor());
+
header->fEmitsPointSize = GrGpu::kDrawPoints_DrawType == drawType;
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything
@@ -277,7 +276,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fExperimentalGS = false;
#endif
#endif
- bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || gpu->caps()->pathRenderingSupport();
+ bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || header->fUseFragShaderOnly;
if (!inputColorIsUsed) {
header->fColorInput = kAllOnes_ColorInput;
@@ -285,7 +284,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fColorInput = kUniform_ColorInput;
} else {
header->fColorInput = kAttribute_ColorInput;
- header->fRequiresVertexShader = true;
+ header->fUseFragShaderOnly = false;
}
bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == optState.getCoverageColor();
@@ -296,7 +295,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fCoverageInput = kUniform_ColorInput;
} else {
header->fCoverageInput = kAttribute_ColorInput;
- header->fRequiresVertexShader = true;
+ header->fUseFragShaderOnly = false;
}
if (optState.readsDst()) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/builders/GrGLFragmentOnlyProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698