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); |
} |