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

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

Issue 553583008: Add counting of some GL calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update for merge conflict 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderStringBuilder.cpp ('k') | tools/PictureBenchmark.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "GrGLFullProgramBuilder.h" 9 #include "GrGLFullProgramBuilder.h"
10 #include "GrGLShaderStringBuilder.h" 10 #include "GrGLShaderStringBuilder.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 SkTDArray<GrGLuint>* shaderIds) const { 113 SkTDArray<GrGLuint>* shaderIds) const {
114 GrGpuGL* gpu = fProgramBuilder->gpu(); 114 GrGpuGL* gpu = fProgramBuilder->gpu();
115 const GrGLContext& glCtx = gpu->glContext(); 115 const GrGLContext& glCtx = gpu->glContext();
116 const GrGLContextInfo& ctxInfo = gpu->ctxInfo(); 116 const GrGLContextInfo& ctxInfo = gpu->ctxInfo();
117 SkString vertShaderSrc(GrGetGLSLVersionDecl(ctxInfo)); 117 SkString vertShaderSrc(GrGetGLSLVersionDecl(ctxInfo));
118 fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &vertShaderSrc); 118 fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &vertShaderSrc);
119 fProgramBuilder->appendDecls(fInputs, &vertShaderSrc); 119 fProgramBuilder->appendDecls(fInputs, &vertShaderSrc);
120 fProgramBuilder->appendDecls(fOutputs, &vertShaderSrc); 120 fProgramBuilder->appendDecls(fOutputs, &vertShaderSrc);
121 vertShaderSrc.append("void main() {"); 121 vertShaderSrc.append("void main() {");
122 vertShaderSrc.append(fCode); 122 vertShaderSrc.append(fCode);
123 vertShaderSrc.append("}"); 123 vertShaderSrc.append("}\n");
124 GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId, 124 GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId,
125 GR_GL_VERTEX_SHADER, vertShaderSrc); 125 GR_GL_VERTEX_SHADER, vert ShaderSrc,
126 gpu->gpuStats());
126 if (!vertShaderId) { 127 if (!vertShaderId) {
127 return false; 128 return false;
128 } 129 }
129 *shaderIds->append() = vertShaderId; 130 *shaderIds->append() = vertShaderId;
130 return true; 131 return true;
131 } 132 }
132 133
133 void GrGLVertexShaderBuilder::emitCodeAfterEffects() { 134 void GrGLVertexShaderBuilder::emitCodeAfterEffects() {
134 const char* rtAdjustName; 135 const char* rtAdjustName;
135 fProgramBuilder->fUniformHandles.fRTAdjustmentUni = 136 fProgramBuilder->fUniformHandles.fRTAdjustmentUni =
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 this->addAttribute(GrShaderVar(coverage_attribute_name(), 193 this->addAttribute(GrShaderVar(coverage_attribute_name(),
193 kVec4f_GrSLType, 194 kVec4f_GrSLType,
194 GrShaderVar::kAttribute_TypeModifier)); 195 GrShaderVar::kAttribute_TypeModifier));
195 const char *vsName, *fsName; 196 const char *vsName, *fsName;
196 fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Coverage", &vsName, &f sName); 197 fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Coverage", &vsName, &f sName);
197 this->codeAppendf("%s = %s;", vsName, coverage_attribute_name()); 198 this->codeAppendf("%s = %s;", vsName, coverage_attribute_name());
198 *coverage = fsName; 199 *coverage = fsName;
199 } 200 }
200 fEffectAttribOffset = fInputs.count(); 201 fEffectAttribOffset = fInputs.count();
201 } 202 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderStringBuilder.cpp ('k') | tools/PictureBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698