OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 uint32_t fAttribs; | 58 uint32_t fAttribs; |
59 size_t fStride; | 59 size_t fStride; |
60 SkString fName; | 60 SkString fName; |
61 typedef Benchmark INHERITED; | 61 typedef Benchmark INHERITED; |
62 }; | 62 }; |
63 | 63 |
64 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 64 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
65 | 65 |
66 GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
ttribs, | 66 GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
ttribs, |
67 uint32_t maxAttribs) { | 67 uint32_t maxAttribs) { |
68 const char* version = ctx->caps()->glslCaps()->versionDeclString(); | 68 const char* version = GrGLGetGLSLVersionDecl(*ctx); |
69 | 69 |
70 // setup vertex shader | 70 // setup vertex shader |
71 GrGLSLShaderVar aPosition("a_position", kVec4f_GrSLType, GrShaderVar::kAttri
bute_TypeModifier); | 71 GrGLSLShaderVar aPosition("a_position", kVec4f_GrSLType, GrShaderVar::kAttri
bute_TypeModifier); |
72 SkTArray<GrGLSLShaderVar> aVars; | 72 SkTArray<GrGLSLShaderVar> aVars; |
73 SkTArray<GrGLSLShaderVar> oVars; | 73 SkTArray<GrGLSLShaderVar> oVars; |
74 | 74 |
75 SkString vshaderTxt(version); | 75 SkString vshaderTxt(version); |
76 aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); | 76 aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); |
77 vshaderTxt.append(";\n"); | 77 vshaderTxt.append(";\n"); |
78 | 78 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 DEF_BENCH( return new GLVertexAttributesBench(0) ) | 262 DEF_BENCH( return new GLVertexAttributesBench(0) ) |
263 DEF_BENCH( return new GLVertexAttributesBench(1) ) | 263 DEF_BENCH( return new GLVertexAttributesBench(1) ) |
264 DEF_BENCH( return new GLVertexAttributesBench(2) ) | 264 DEF_BENCH( return new GLVertexAttributesBench(2) ) |
265 DEF_BENCH( return new GLVertexAttributesBench(3) ) | 265 DEF_BENCH( return new GLVertexAttributesBench(3) ) |
266 DEF_BENCH( return new GLVertexAttributesBench(4) ) | 266 DEF_BENCH( return new GLVertexAttributesBench(4) ) |
267 DEF_BENCH( return new GLVertexAttributesBench(5) ) | 267 DEF_BENCH( return new GLVertexAttributesBench(5) ) |
268 DEF_BENCH( return new GLVertexAttributesBench(6) ) | 268 DEF_BENCH( return new GLVertexAttributesBench(6) ) |
269 DEF_BENCH( return new GLVertexAttributesBench(7) ) | 269 DEF_BENCH( return new GLVertexAttributesBench(7) ) |
270 #endif | 270 #endif |
OLD | NEW |