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

Unified Diff: remoting/client/gl_helpers.cc

Issue 2614443003: Moving the GL implementation details into a sub folder for client display. (Closed)
Patch Set: Adding deps restriction on r/c/display; Moving sys_opengl.h Created 3 years, 11 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 | « remoting/client/gl_helpers.h ('k') | remoting/client/gl_math.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/gl_helpers.cc
diff --git a/remoting/client/gl_helpers.cc b/remoting/client/gl_helpers.cc
deleted file mode 100644
index 5cd1863ea1994a0f2a35b9dbc2c75f33f8fce144..0000000000000000000000000000000000000000
--- a/remoting/client/gl_helpers.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/client/gl_helpers.h"
-
-#include "base/logging.h"
-
-namespace remoting {
-
-GLuint CompileShader(GLenum shader_type, const char* shader_source) {
- GLuint shader = glCreateShader(shader_type);
-
- if (shader != 0) {
- int shader_source_length = strlen(shader_source);
- // Pass in the shader source.
- glShaderSource(shader, 1, &shader_source, &shader_source_length);
-
- // Compile the shader.
- glCompileShader(shader);
-
- // Get the compilation status.
- GLint compile_status;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status);
-
- // If the compilation failed, delete the shader.
- if (compile_status == GL_FALSE) {
- LOG(ERROR) << "Error compiling shader: \n" << shader_source;
- glDeleteShader(shader);
- shader = 0;
- }
- }
-
- if (shader == 0) {
- LOG(FATAL) << "Error creating shader.";
- }
-
- return shader;
-}
-
-GLuint CreateProgram(GLuint vertex_shader, GLuint fragment_shader) {
- GLuint program = glCreateProgram();
-
- if (program != 0) {
- glAttachShader(program, vertex_shader);
- glAttachShader(program, fragment_shader);
- glLinkProgram(program);
-
- // Get the link status.
- GLint link_status;
- glGetProgramiv(program, GL_LINK_STATUS, &link_status);
- // If the link failed, delete the program.
- if (link_status == GL_FALSE) {
- LOG(ERROR) << "Error compiling program.";
- glDeleteProgram(program);
- program = 0;
- }
- }
-
- if (program == 0) {
- LOG(FATAL) << "Error creating program.";
- }
-
- return program;
-}
-
-GLuint CreateTexture() {
- GLuint texture;
- glGenTextures(1, &texture);
- if (texture == 0) {
- LOG(FATAL) << "Error creating texture.";
- }
- return texture;
-}
-
-GLuint CreateBuffer(const void* data, int size) {
- GLuint buffer;
- glGenBuffers(1, &buffer);
- glBindBuffer(GL_ARRAY_BUFFER, buffer);
- glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- return buffer;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/client/gl_helpers.h ('k') | remoting/client/gl_math.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698