| Index: bench/GLBench.cpp
|
| diff --git a/bench/GLBench.cpp b/bench/GLBench.cpp
|
| index b6975508cfe7335b4bc4e5743348b181d80aaf50..8cf41c205665100d173201a0925bd8fe4a154b0a 100644
|
| --- a/bench/GLBench.cpp
|
| +++ b/bench/GLBench.cpp
|
| @@ -11,10 +11,7 @@
|
| #include "GrGpu.h"
|
| #include "GrTest.h"
|
| #include "gl/GrGLContext.h"
|
| -#include "gl/builders/GrGLShaderStringBuilder.h"
|
| -#include "SkSLCompiler.h"
|
| #include <stdio.h>
|
| -#include <string>
|
|
|
| const GrGLContext* GLBench::getGLContext(SkCanvas* canvas) {
|
| // This bench exclusively tests GL calls directly
|
| @@ -64,26 +61,13 @@
|
| canvas->getGrContext()->resetContext();
|
| }
|
|
|
| -GrGLuint GLBench::CompileShader(const GrGLContext* context, const char* sksl, GrGLenum type) {
|
| - const GrGLInterface* gl = context->interface();
|
| - std::string glsl;
|
| - bool result = context->compiler()->toGLSL(type == GR_GL_VERTEX_SHADER
|
| - ? SkSL::Program::kVertex_Kind
|
| - : SkSL::Program::kFragment_Kind,
|
| - std::string(sksl),
|
| - GrGLSkSLCapsForContext(*context),
|
| - &glsl);
|
| - if (!result) {
|
| - SkDebugf("SkSL compilation failed:\n%s\n%s\n", sksl,
|
| - context->compiler()->errorText().c_str());
|
| - }
|
| +GrGLuint GLBench::CompileShader(const GrGLInterface* gl, const char* shaderSrc, GrGLenum type) {
|
| GrGLuint shader;
|
| // Create the shader object
|
| GR_GL_CALL_RET(gl, shader, CreateShader(type));
|
|
|
| // Load the shader source
|
| - const char* glslPtr = glsl.c_str();
|
| - GR_GL_CALL(gl, ShaderSource(shader, 1, (const char**) &glslPtr, nullptr));
|
| + GR_GL_CALL(gl, ShaderSource(shader, 1, &shaderSrc, nullptr));
|
|
|
| // Compile the shader
|
| GR_GL_CALL(gl, CompileShader(shader));
|
| @@ -100,11 +84,10 @@
|
| return shader;
|
| }
|
|
|
| -GrGLuint GLBench::CreateProgram(const GrGLContext* context, const char* vshader,
|
| - const char* fshader) {
|
| - const GrGLInterface* gl = context->interface();
|
| - GrGLuint vertexShader = CompileShader(context, vshader, GR_GL_VERTEX_SHADER);
|
| - GrGLuint fragmentShader = CompileShader(context, fshader, GR_GL_FRAGMENT_SHADER);
|
| +GrGLuint GLBench::CreateProgram(const GrGLInterface* gl, const char* vshader, const char* fshader) {
|
| +
|
| + GrGLuint vertexShader = CompileShader(gl, vshader, GR_GL_VERTEX_SHADER);
|
| + GrGLuint fragmentShader = CompileShader(gl, fshader, GR_GL_FRAGMENT_SHADER);
|
|
|
| GrGLuint shaderProgram;
|
| GR_GL_CALL_RET(gl, shaderProgram, CreateProgram());
|
|
|