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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
6 | 6 |
7 #include "../client/gles2_implementation.h" | 7 #include "../client/gles2_implementation.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2459 void GLES2Implementation::DeleteTexturesHelper( | 2459 void GLES2Implementation::DeleteTexturesHelper( |
2460 GLsizei n, const GLuint* textures) { | 2460 GLsizei n, const GLuint* textures) { |
2461 if (!id_handlers_[id_namespaces::kTextures]->FreeIds(n, textures)) { | 2461 if (!id_handlers_[id_namespaces::kTextures]->FreeIds(n, textures)) { |
2462 SetGLError( | 2462 SetGLError( |
2463 GL_INVALID_VALUE, | 2463 GL_INVALID_VALUE, |
2464 "glDeleteTextures: id not created by this context."); | 2464 "glDeleteTextures: id not created by this context."); |
2465 return; | 2465 return; |
2466 } | 2466 } |
2467 for (GLsizei ii = 0; ii < n; ++ii) { | 2467 for (GLsizei ii = 0; ii < n; ++ii) { |
2468 for (GLint tt = 0; tt < gl_state_.max_combined_texture_image_units; ++tt) { | 2468 for (GLint tt = 0; tt < gl_state_.max_combined_texture_image_units; ++tt) { |
2469 TextureUnit& unit = texture_units_[active_texture_unit_]; | 2469 TextureUnit& unit = texture_units_[tt]; |
2470 if (textures[ii] == unit.bound_texture_2d) { | 2470 if (textures[ii] == unit.bound_texture_2d) { |
2471 unit.bound_texture_2d = 0; | 2471 unit.bound_texture_2d = 0; |
2472 } | 2472 } |
2473 if (textures[ii] == unit.bound_texture_cube_map) { | 2473 if (textures[ii] == unit.bound_texture_cube_map) { |
2474 unit.bound_texture_cube_map = 0; | 2474 unit.bound_texture_cube_map = 0; |
2475 } | 2475 } |
2476 } | 2476 } |
2477 } | 2477 } |
2478 helper_->DeleteTexturesImmediate(n, textures); | 2478 helper_->DeleteTexturesImmediate(n, textures); |
2479 } | 2479 } |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3254 helper_->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); | 3254 helper_->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
3255 } | 3255 } |
3256 #else | 3256 #else |
3257 helper_->DrawElementsInstancedANGLE( | 3257 helper_->DrawElementsInstancedANGLE( |
3258 mode, count, type, ToGLuint(indices), primcount); | 3258 mode, count, type, ToGLuint(indices), primcount); |
3259 #endif | 3259 #endif |
3260 } | 3260 } |
3261 | 3261 |
3262 } // namespace gles2 | 3262 } // namespace gles2 |
3263 } // namespace gpu | 3263 } // namespace gpu |
OLD | NEW |