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

Side by Side Diff: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp

Issue 820783005: More changes to bring together path / geo procs (Closed) Base URL: https://skia.googlesource.com/skia.git@lc1
Patch Set: some asserts for safety Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLVertexShaderBuilder.h" 8 #include "GrGLVertexShaderBuilder.h"
9 #include "GrGLProgramBuilder.h" 9 #include "GrGLProgramBuilder.h"
10 #include "GrGLShaderStringBuilder.h" 10 #include "GrGLShaderStringBuilder.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Transform from Skia's device coords to GL's normalized device coords. 48 // Transform from Skia's device coords to GL's normalized device coords.
49 this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy), dot(%s.yz, %s.zw), 0, %s.z);", 49 this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy), dot(%s.yz, %s.zw), 0, %s.z);",
50 pos3, fRtAdjustName, pos3, fRtAdjustName, pos3); 50 pos3, fRtAdjustName, pos3, fRtAdjustName, pos3);
51 51
52 // We could have the GrGeometryProcessor do this, but its just easier to hav e it performed here. 52 // We could have the GrGeometryProcessor do this, but its just easier to hav e it performed here.
53 // If we ever need to set variable pointsize, then we can reinvestigate 53 // If we ever need to set variable pointsize, then we can reinvestigate
54 this->codeAppend("gl_PointSize = 1.0;"); 54 this->codeAppend("gl_PointSize = 1.0;");
55 } 55 }
56 56
57 void GrGLVertexBuilder::bindVertexAttributes(GrGLuint programID) { 57 void GrGLVertexBuilder::bindVertexAttributes(GrGLuint programID) {
58 const GrGeometryProcessor* gp = fProgramBuilder->fOptState.getGeometryProces sor(); 58 const GrPrimitiveProcessor* primProc = fProgramBuilder->fOptState.getPrimiti veProcessor();
59 59
60 const GrGeometryProcessor::VertexAttribArray& v = gp->getAttribs(); 60 const GrGeometryProcessor::VertexAttribArray& v = primProc->getAttribs();
61 int vaCount = v.count(); 61 int vaCount = v.count();
62 for (int i = 0; i < vaCount; i++) { 62 for (int i = 0; i < vaCount; i++) {
63 GL_CALL(BindAttribLocation(programID, i, v[i].fName)); 63 GL_CALL(BindAttribLocation(programID, i, v[i].fName));
64 } 64 }
65 return; 65 return;
66 } 66 }
67 67
68 bool GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId, 68 bool GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId,
69 SkTDArray<GrGLuint>* shaderIds) const { 69 SkTDArray<GrGLuint>* shaderIds) const {
70 GrGLGpu* gpu = fProgramBuilder->gpu(); 70 GrGLGpu* gpu = fProgramBuilder->gpu();
(...skipping 21 matching lines...) Expand all
92 for (int i = 0; i < fInputs.count(); ++i) { 92 for (int i = 0; i < fInputs.count(); ++i) {
93 const GrGLShaderVar& attr = fInputs[i]; 93 const GrGLShaderVar& attr = fInputs[i];
94 // if attribute already added, don't add it again 94 // if attribute already added, don't add it again
95 if (attr.getName().equals(var.getName())) { 95 if (attr.getName().equals(var.getName())) {
96 return false; 96 return false;
97 } 97 }
98 } 98 }
99 fInputs.push_back(var); 99 fInputs.push_back(var);
100 return true; 100 return true;
101 } 101 }
OLDNEW
« src/gpu/GrGeometryProcessor.h ('K') | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698