| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 uint32_t fDrawDiv; | 100 uint32_t fDrawDiv; |
| 101 SkTArray<GrGLuint> fBuffers; | 101 SkTArray<GrGLuint> fBuffers; |
| 102 GrGLuint fProgram; | 102 GrGLuint fProgram; |
| 103 GrGLuint fVAO; | 103 GrGLuint fVAO; |
| 104 GrGLuint fTexture; | 104 GrGLuint fTexture; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 107 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 108 | 108 |
| 109 GrGLuint GLCpuPosInstancedArraysBench::setupShader(const GrGLContext* ctx) { | 109 GrGLuint GLCpuPosInstancedArraysBench::setupShader(const GrGLContext* ctx) { |
| 110 const char* version = ctx->caps()->glslCaps()->versionDeclString(); | 110 const char* version = GrGLGetGLSLVersionDecl(*ctx); |
| 111 | 111 |
| 112 // setup vertex shader | 112 // setup vertex shader |
| 113 GrGLSLShaderVar aPosition("a_position", kVec2f_GrSLType, GrShaderVar::kAttri
bute_TypeModifier); | 113 GrGLSLShaderVar aPosition("a_position", kVec2f_GrSLType, GrShaderVar::kAttri
bute_TypeModifier); |
| 114 GrGLSLShaderVar aColor("a_color", kVec3f_GrSLType, GrShaderVar::kAttribute_T
ypeModifier); | 114 GrGLSLShaderVar aColor("a_color", kVec3f_GrSLType, GrShaderVar::kAttribute_T
ypeModifier); |
| 115 GrGLSLShaderVar oColor("o_color", kVec3f_GrSLType, GrShaderVar::kVaryingOut_
TypeModifier); | 115 GrGLSLShaderVar oColor("o_color", kVec3f_GrSLType, GrShaderVar::kVaryingOut_
TypeModifier); |
| 116 | 116 |
| 117 SkString vshaderTxt(version); | 117 SkString vshaderTxt(version); |
| 118 aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); | 118 aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); |
| 119 vshaderTxt.append(";\n"); | 119 vshaderTxt.append(";\n"); |
| 120 aColor.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); | 120 aColor.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 1) ) | 389 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 1) ) |
| 390 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 1) ) | 390 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 1) ) |
| 391 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 2) ) | 391 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 2) ) |
| 392 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 2) ) | 392 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 2) ) |
| 393 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 4) ) | 393 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 4) ) |
| 394 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 4) ) | 394 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 4) ) |
| 395 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 8) ) | 395 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 8) ) |
| 396 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 8) ) | 396 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 8) ) |
| 397 | 397 |
| 398 #endif | 398 #endif |
| OLD | NEW |