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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 900543004: Clean up some of the shader compilation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index f37c61a4808d9832879583c2321d05c2fdac9602..aff07dcfe5add1161890633aae771de483c37379 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -7050,15 +7050,21 @@ GLuint GLES2DecoderImpl::DoGetMaxValueInBufferCHROMIUM(
void GLES2DecoderImpl::DoShaderSource(
GLuint client_id, GLsizei count, const char** data, const GLint* length) {
std::string str;
- for (GLsizei ii = 0; ii < count; ++ii) {
- str.append(data[ii]);
+ if (length) {
+ for (GLsizei ii = 0; ii < count; ++ii) {
+ str.append(data[ii], length[ii]);
vmiura 2015/02/04 05:49:02 I believe the spec is that if length[ii] is NULL t
vmiura 2015/02/04 05:55:51 Btw, is this a bug fix that should be in it's own
David Yen 2015/02/04 19:13:33 Done. Strictly speaking this is not a bug fix. It
+ }
+ } else {
+ for (GLsizei ii = 0; ii < count; ++ii) {
+ str.append(data[ii]);
+ }
}
Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource");
if (!shader) {
return;
}
// Note: We don't actually call glShaderSource here. We wait until
- // the call to glCompileShader.
+ // we actually compile the shader.
shader->set_source(str);
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/shader_manager.cc » ('j') | gpu/command_buffer/service/shader_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698