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

Unified Diff: gpu/command_buffer/client/gles2_implementation_autogen.h

Issue 7358006: Cache OpenGL program info on the client side of the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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/client/gles2_implementation.cc ('k') | gpu/command_buffer/client/program_info_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation_autogen.h
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index 728ef5efadeb50fd00dcf59379c63a67b875e2f9..245b726b1fa100ca7c15fe5479036b2ea61c4df8 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -249,7 +249,7 @@ void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
void DeleteProgram(GLuint program) {
GPU_CLIENT_LOG("[" << this << "] glDeleteProgram(" << program << ")");
GPU_CLIENT_DCHECK(program != 0);
- program_and_shader_id_handler_->FreeIds(1, &program);
+ DeleteProgramOrShaderHelper(program);
helper_->DeleteProgram(program);
Flush();
}
@@ -278,7 +278,7 @@ void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
void DeleteShader(GLuint shader) {
GPU_CLIENT_LOG("[" << this << "] glDeleteShader(" << shader << ")");
GPU_CLIENT_DCHECK(shader != 0);
- program_and_shader_id_handler_->FreeIds(1, &shader);
+ DeleteProgramOrShaderHelper(shader);
helper_->DeleteShader(shader);
Flush();
}
@@ -571,19 +571,20 @@ void GetProgramInfoLog(
<< static_cast<void*>(infolog) << ")");
helper_->SetBucketSize(kResultBucketId, 0);
helper_->GetProgramInfoLog(program, kResultBucketId);
- if (bufsize > 0) {
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
+ std::string str;
+ GLsizei max_size = 0;
+ if (GetBucketAsString(kResultBucketId, &str)) {
+ if (bufsize > 0) {
+ max_size =
std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
memcpy(infolog, str.c_str(), max_size);
infolog[max_size] = '\0';
GPU_CLIENT_LOG("------\n" << infolog << "\n------");
}
}
+ if (length != NULL) {
+ *length = max_size;
+ }
}
void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) {
GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
@@ -633,19 +634,20 @@ void GetShaderInfoLog(
<< static_cast<void*>(infolog) << ")");
helper_->SetBucketSize(kResultBucketId, 0);
helper_->GetShaderInfoLog(shader, kResultBucketId);
- if (bufsize > 0) {
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
+ std::string str;
+ GLsizei max_size = 0;
+ if (GetBucketAsString(kResultBucketId, &str)) {
+ if (bufsize > 0) {
+ max_size =
std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
memcpy(infolog, str.c_str(), max_size);
infolog[max_size] = '\0';
GPU_CLIENT_LOG("------\n" << infolog << "\n------");
}
}
+ if (length != NULL) {
+ *length = max_size;
+ }
}
void GetShaderPrecisionFormat(
GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
@@ -660,19 +662,20 @@ void GetShaderSource(
<< static_cast<void*>(source) << ")");
helper_->SetBucketSize(kResultBucketId, 0);
helper_->GetShaderSource(shader, kResultBucketId);
- if (bufsize > 0) {
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
+ std::string str;
+ GLsizei max_size = 0;
+ if (GetBucketAsString(kResultBucketId, &str)) {
+ if (bufsize > 0) {
+ max_size =
std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
memcpy(source, str.c_str(), max_size);
source[max_size] = '\0';
GPU_CLIENT_LOG("------\n" << source << "\n------");
}
}
+ if (length != NULL) {
+ *length = max_size;
+ }
}
const GLubyte* GetString(GLenum name);
@@ -809,10 +812,7 @@ void LineWidth(GLfloat width) {
helper_->LineWidth(width);
}
-void LinkProgram(GLuint program) {
- GPU_CLIENT_LOG("[" << this << "] glLinkProgram(" << program << ")");
- helper_->LinkProgram(program);
-}
+void LinkProgram(GLuint program);
void PixelStorei(GLenum pname, GLint param);
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/client/program_info_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698