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 "SkMatrix.h" | 8 #include "SkMatrix.h" |
9 #include "SkPoint.h" | 9 #include "SkPoint.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 GR_GL_CALL(gl, VertexAttribPointer(0, 2, GR_GL_FLOAT, GR_GL_FALSE, sizeof(Ve
rtex), | 239 GR_GL_CALL(gl, VertexAttribPointer(0, 2, GR_GL_FLOAT, GR_GL_FALSE, sizeof(Ve
rtex), |
240 (GrGLvoid*)0)); | 240 (GrGLvoid*)0)); |
241 GR_GL_CALL(gl, VertexAttribPointer(1, 3, GR_GL_FLOAT, GR_GL_FALSE, sizeof(Ve
rtex), | 241 GR_GL_CALL(gl, VertexAttribPointer(1, 3, GR_GL_FLOAT, GR_GL_FALSE, sizeof(Ve
rtex), |
242 (GrGLvoid*)(sizeof(SkPoint)))); | 242 (GrGLvoid*)(sizeof(SkPoint)))); |
243 GR_GL_CALL(gl, BufferData(GR_GL_ARRAY_BUFFER, sizeof(vertices), vertices, GR
_GL_STATIC_DRAW)); | 243 GR_GL_CALL(gl, BufferData(GR_GL_ARRAY_BUFFER, sizeof(vertices), vertices, GR
_GL_STATIC_DRAW)); |
244 } | 244 } |
245 | 245 |
246 void GLVec4ScalarBench::setup(const GrGLContext* ctx) { | 246 void GLVec4ScalarBench::setup(const GrGLContext* ctx) { |
247 const GrGLInterface* gl = ctx->interface(); | 247 const GrGLInterface* gl = ctx->interface(); |
248 if (!gl) { | 248 if (!gl) { |
249 SkFAIL("GL interface is NULL in setup()!\n"); | 249 SkFAIL("GL interface is nullptr in setup()!\n"); |
250 } | 250 } |
251 fFboTextureId = SetupFramebuffer(gl, kScreenWidth, kScreenHeight); | 251 fFboTextureId = SetupFramebuffer(gl, kScreenWidth, kScreenHeight); |
252 | 252 |
253 fProgram = this->setupShader(ctx); | 253 fProgram = this->setupShader(ctx); |
254 | 254 |
255 int index = 0; | 255 int index = 0; |
256 SkMatrix viewMatrices[kNumTriPerDraw]; | 256 SkMatrix viewMatrices[kNumTriPerDraw]; |
257 setup_matrices(kNumTriPerDraw, [&index, &viewMatrices](const SkMatrix& m) { | 257 setup_matrices(kNumTriPerDraw, [&index, &viewMatrices](const SkMatrix& m) { |
258 viewMatrices[index++] = m; | 258 viewMatrices[index++] = m; |
259 }); | 259 }); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 2) ) | 294 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 2) ) |
295 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 2) ) | 295 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 2) ) |
296 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 4) ) | 296 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 4) ) |
297 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 4) ) | 297 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 4) ) |
298 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 6) ) | 298 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 6) ) |
299 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 6) ) | 299 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 6) ) |
300 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 8) ) | 300 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseScalar_CoverageSe
tup, 8) ) |
301 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 8) ) | 301 DEF_BENCH( return new GLVec4ScalarBench(GLVec4ScalarBench::kUseVec4_CoverageSetu
p, 8) ) |
302 | 302 |
303 #endif | 303 #endif |
OLD | NEW |