| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 1.0f, 1.0f, | 361 1.0f, 1.0f, |
| 362 -1.0f, 1.0f}; | 362 -1.0f, 1.0f}; |
| 363 glBufferData( | 363 glBufferData( |
| 364 GL_ARRAY_BUFFER, sizeof(kQuadVertices), kQuadVertices, GL_STATIC_DRAW); | 364 GL_ARRAY_BUFFER, sizeof(kQuadVertices), kQuadVertices, GL_STATIC_DRAW); |
| 365 | 365 |
| 366 glGenFramebuffersEXT(1, &framebuffer_); | 366 glGenFramebuffersEXT(1, &framebuffer_); |
| 367 | 367 |
| 368 if (vertex_array_object_id_) { | 368 if (vertex_array_object_id_) { |
| 369 glEnableVertexAttribArray(kVertexPositionAttrib); | 369 glEnableVertexAttribArray(kVertexPositionAttrib); |
| 370 glVertexAttribPointer(kVertexPositionAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0); | 370 glVertexAttribPointer(kVertexPositionAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0); |
| 371 decoder->RestoreAllAttributes(); |
| 371 } | 372 } |
| 372 | 373 |
| 373 decoder->RestoreAllAttributes(); | |
| 374 decoder->RestoreBufferBindings(); | 374 decoder->RestoreBufferBindings(); |
| 375 | 375 |
| 376 initialized_ = true; | 376 initialized_ = true; |
| 377 } | 377 } |
| 378 | 378 |
| 379 void CopyTextureCHROMIUMResourceManager::Destroy() { | 379 void CopyTextureCHROMIUMResourceManager::Destroy() { |
| 380 if (!initialized_) | 380 if (!initialized_) |
| 381 return; | 381 return; |
| 382 | 382 |
| 383 if (vertex_array_object_id_) { | 383 if (vertex_array_object_id_) { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 decoder->RestoreTextureState(dest_id); | 726 decoder->RestoreTextureState(dest_id); |
| 727 decoder->RestoreTextureUnitBindings(0); | 727 decoder->RestoreTextureUnitBindings(0); |
| 728 decoder->RestoreActiveTexture(); | 728 decoder->RestoreActiveTexture(); |
| 729 decoder->RestoreProgramBindings(); | 729 decoder->RestoreProgramBindings(); |
| 730 decoder->RestoreBufferBindings(); | 730 decoder->RestoreBufferBindings(); |
| 731 decoder->RestoreFramebufferBindings(); | 731 decoder->RestoreFramebufferBindings(); |
| 732 decoder->RestoreGlobalState(); | 732 decoder->RestoreGlobalState(); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace gpu | 735 } // namespace gpu |
| OLD | NEW |