Index: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
index 36f2b42bd6c2d038cba5ba192d7f7f966f789465..97bdec737d8c72a615b843ba579e0050726bc3e5 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc |
@@ -388,6 +388,9 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( |
glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dest_target, |
dest_id, level); |
+ GLint maxAttribs = 0; |
Zhenyao Mo
2014/02/11 19:01:20
name should be max_attribs
|
+ glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs); |
+ |
#ifndef NDEBUG |
GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); |
if (GL_FRAMEBUFFER_COMPLETE != fb_status) { |
@@ -396,6 +399,8 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( |
#endif |
{ |
glEnableVertexAttribArray(kVertexPositionAttrib); |
+ for(int i = 1; i < maxAttribs; ++i) |
Zhenyao Mo
2014/02/11 19:01:20
space after for
|
+ glDisableVertexAttribArray(i); |
Zhenyao Mo
2014/02/11 19:01:20
Here you should not make the assumption kVertexPos
|
glBindBuffer(GL_ARRAY_BUFFER, buffer_id_); |
glVertexAttribPointer(kVertexPositionAttrib, 4, GL_FLOAT, GL_FALSE, |
@@ -421,7 +426,8 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( |
glDrawArrays(GL_TRIANGLE_FAN, 0, 4); |
} |
- decoder->RestoreAttribute(kVertexPositionAttrib); |
+ for(int i = 0; i < maxAttribs; ++i) |
Zhenyao Mo
2014/02/11 19:01:20
space after for
|
+ decoder->RestoreAttribute(i); |
decoder->RestoreTextureState(source_id); |
decoder->RestoreTextureState(dest_id); |
decoder->RestoreTextureUnitBindings(0); |