Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: gpu/command_buffer/tests/gl_test_utils.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.h ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_test_utils.cc
diff --git a/gpu/command_buffer/tests/gl_test_utils.cc b/gpu/command_buffer/tests/gl_test_utils.cc
index d3272ca7da61e2d3d3d4326aff83b32a16d0d85d..7582a5d72ef19f7222a10cf73726e8c8f0d061d6 100644
--- a/gpu/command_buffer/tests/gl_test_utils.cc
+++ b/gpu/command_buffer/tests/gl_test_utils.cc
@@ -31,12 +31,19 @@ bool GLTestHelper::CheckGLError(const char* msg, int line) {
return success;
}
-GLuint GLTestHelper::LoadShader(GLenum type, const char* shaderSrc) {
+GLuint GLTestHelper::CompileShader(GLenum type, const char* shaderSrc) {
GLuint shader = glCreateShader(type);
// Load the shader source
glShaderSource(shader, 1, &shaderSrc, NULL);
// Compile the shader
glCompileShader(shader);
+
+ return shader;
+}
+
+GLuint GLTestHelper::LoadShader(GLenum type, const char* shaderSrc) {
+ GLuint shader = CompileShader(type, shaderSrc);
+
// Check the compile status
GLint value = 0;
glGetShaderiv(shader, GL_COMPILE_STATUS, &value);
@@ -52,7 +59,7 @@ GLuint GLTestHelper::LoadShader(GLenum type, const char* shaderSrc) {
return shader;
}
-GLuint GLTestHelper::SetupProgram(
+GLuint GLTestHelper::LinkProgram(
GLuint vertex_shader, GLuint fragment_shader) {
// Create the program object
GLuint program = glCreateProgram();
@@ -60,6 +67,13 @@ GLuint GLTestHelper::SetupProgram(
glAttachShader(program, fragment_shader);
// Link the program
glLinkProgram(program);
+
+ return program;
+}
+
+GLuint GLTestHelper::SetupProgram(
+ GLuint vertex_shader, GLuint fragment_shader) {
+ GLuint program = LinkProgram(vertex_shader, fragment_shader);
// Check the link status
GLint linked = 0;
glGetProgramiv(program, GL_LINK_STATUS, &linked);
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.h ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698