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

Unified Diff: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp

Issue 628293002: Plumb OptDrawState down to VertexShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up 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
Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index 4877071d77686beefc1d03d05a36ffe9be47a6f1..cb3ef7e3d0727594e0b2dc731057f5eb13cc5021 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -57,7 +57,8 @@ void GrGLVertexShaderBuilder::addVarying(GrSLType type, const char* name, const
}
-void GrGLVertexShaderBuilder::bindProgramLocations(GrGLuint programId) {
+void GrGLVertexShaderBuilder::bindProgramLocations(const GrOptDrawState& optState,
+ GrGLuint programId) {
const GrGLProgramDesc::KeyHeader& header = fProgramBuilder->desc().getHeader();
GrGpuGL* gpu = fProgramBuilder->gpu();
@@ -82,14 +83,8 @@ void GrGLVertexShaderBuilder::bindProgramLocations(GrGLuint programId) {
coverage_attribute_name()));
}
- // We pull the current state of attributes off of drawstate's optimized state and bind them in
- // order. This assumes that the drawState has not changed since we called flushGraphicsState()
- // higher up in the stack.
- const GrDrawTargetCaps* caps = fProgramBuilder->gpu()->caps();
- const GrDrawState& drawState = *fProgramBuilder->gpu()->drawState();
- SkAutoTUnref<GrOptDrawState> optState(drawState.createOptState(*caps));
- const GrVertexAttrib* vaPtr = optState->getVertexAttribs();
- const int vaCount = optState->getVertexAttribCount();
+ const GrVertexAttrib* vaPtr = optState.getVertexAttribs();
+ const int vaCount = optState.getVertexAttribCount();
int i = fEffectAttribOffset;
for (int index = 0; index < vaCount; index++) {

Powered by Google App Engine
This is Rietveld 408576698