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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 10179006: Unbind texture from all texture units when deleting it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 GLsizei n, const GLuint* textures) { 2327 GLsizei n, const GLuint* textures) {
2328 if (!GetIdHandler(id_namespaces::kTextures)->FreeIds( 2328 if (!GetIdHandler(id_namespaces::kTextures)->FreeIds(
2329 this, n, textures, &GLES2Implementation::DeleteTexturesStub)) { 2329 this, n, textures, &GLES2Implementation::DeleteTexturesStub)) {
2330 SetGLError( 2330 SetGLError(
2331 GL_INVALID_VALUE, 2331 GL_INVALID_VALUE,
2332 "glDeleteTextures: id not created by this context."); 2332 "glDeleteTextures: id not created by this context.");
2333 return; 2333 return;
2334 } 2334 }
2335 for (GLsizei ii = 0; ii < n; ++ii) { 2335 for (GLsizei ii = 0; ii < n; ++ii) {
2336 for (GLint tt = 0; tt < gl_state_.max_combined_texture_image_units; ++tt) { 2336 for (GLint tt = 0; tt < gl_state_.max_combined_texture_image_units; ++tt) {
2337 TextureUnit& unit = texture_units_[active_texture_unit_]; 2337 TextureUnit& unit = texture_units_[tt];
2338 if (textures[ii] == unit.bound_texture_2d) { 2338 if (textures[ii] == unit.bound_texture_2d) {
2339 unit.bound_texture_2d = 0; 2339 unit.bound_texture_2d = 0;
2340 } 2340 }
2341 if (textures[ii] == unit.bound_texture_cube_map) { 2341 if (textures[ii] == unit.bound_texture_cube_map) {
2342 unit.bound_texture_cube_map = 0; 2342 unit.bound_texture_cube_map = 0;
2343 } 2343 }
2344 } 2344 }
2345 } 2345 }
2346 } 2346 }
2347 2347
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 helper_->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); 3133 helper_->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
3134 } 3134 }
3135 #else 3135 #else
3136 helper_->DrawElementsInstancedANGLE( 3136 helper_->DrawElementsInstancedANGLE(
3137 mode, count, type, ToGLuint(indices), primcount); 3137 mode, count, type, ToGLuint(indices), primcount);
3138 #endif 3138 #endif
3139 } 3139 }
3140 3140
3141 } // namespace gles2 3141 } // namespace gles2
3142 } // namespace gpu 3142 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698