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

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

Issue 212753002: Use fixed function pipeline only when drawing paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/GrGLProgramEffects.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 b6029fe4ee193befd5e1d426c0b4e01dcc80e95e..4039eaf95cd858ad4493606ced84007e31da550d 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -37,7 +37,7 @@ inline GrGLEffect::EffectKey get_key_and_update_stats(const GrEffectStage& stage
}
}
void GrGLProgramDesc::Build(const GrDrawState& drawState,
- bool isPoints,
+ GrGpu::DrawType drawType,
GrDrawState::BlendOptFlags blendOpts,
GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff,
@@ -113,7 +113,10 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
int currEffectKey = 0;
bool readsDst = false;
bool readFragPosition = false;
- bool hasVertexCode = false;
+ // We use vertexshader-less shader programs only when drawing paths.
+ bool hasVertexCode = !(GrGpu::kDrawPath_DrawType == drawType ||
+ GrGpu::kDrawPaths_DrawType == drawType);
+
if (!skipColor) {
for (int s = firstEffectiveColorStage; s < drawState.numColorStages(); ++s) {
effectKeys[currEffectKey++] =
@@ -132,7 +135,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
}
header->fHasVertexCode = hasVertexCode || requiresLocalCoordAttrib;
- header->fEmitsPointSize = isPoints;
+ header->fEmitsPointSize = GrGpu::kDrawPoints_DrawType == drawType;
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything
// other than pass through values from the VS to the FS anyway).
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGLProgramEffects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698