| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 m.setScale(0.0001f, 0.0001f); | 165 m.setScale(0.0001f, 0.0001f); |
| 166 f(m); | 166 f(m); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 170 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 171 | 171 |
| 172 const GrGLContext* GLCpuPosInstancedArraysBench::onGetGLContext(const GrGLContex
t* ctx) { | 172 const GrGLContext* GLCpuPosInstancedArraysBench::onGetGLContext(const GrGLContex
t* ctx) { |
| 173 // We only care about gpus with drawArraysInstanced support | 173 // We only care about gpus with drawArraysInstanced support |
| 174 if (!ctx->interface()->fFunctions.fDrawArraysInstanced) { | 174 if (!ctx->interface()->fFunctions.fDrawArraysInstanced) { |
| 175 return NULL; | 175 return nullptr; |
| 176 } | 176 } |
| 177 return ctx; | 177 return ctx; |
| 178 } | 178 } |
| 179 | 179 |
| 180 void GLCpuPosInstancedArraysBench::setupInstanceVbo(const GrGLInterface* gl, | 180 void GLCpuPosInstancedArraysBench::setupInstanceVbo(const GrGLInterface* gl, |
| 181 const SkMatrix* viewMatrices
) { | 181 const SkMatrix* viewMatrices
) { |
| 182 // We draw all of the instances at a single place because we aren't allowed
to have per vertex | 182 // We draw all of the instances at a single place because we aren't allowed
to have per vertex |
| 183 // per instance attributes | 183 // per instance attributes |
| 184 SkPoint positions[kVerticesPerTri]; | 184 SkPoint positions[kVerticesPerTri]; |
| 185 positions[0].set(-1.0f, -1.0f); | 185 positions[0].set(-1.0f, -1.0f); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 1) ) | 388 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 1) ) |
| 389 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 1) ) | 389 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 1) ) |
| 390 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 2) ) | 390 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 2) ) |
| 391 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 2) ) | 391 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 2) ) |
| 392 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 4) ) | 392 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 4) ) |
| 393 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 4) ) | 393 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 4) ) |
| 394 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 8) ) | 394 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseOne_VboSetup, 8) ) |
| 395 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 8) ) | 395 DEF_BENCH( return new GLCpuPosInstancedArraysBench(GLCpuPosInstancedArraysBench:
:kUseTwo_VboSetup, 8) ) |
| 396 | 396 |
| 397 #endif | 397 #endif |
| OLD | NEW |