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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2693273002: Handle GLES2::ConsumeTextureCHROMIUM consuming the currently bound texture. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 17265 matching lines...) Expand 10 before | Expand all | Expand 10 after
17276 "glConsumeTextureCHROMIUM", "invalid mailbox name"); 17276 "glConsumeTextureCHROMIUM", "invalid mailbox name");
17277 return; 17277 return;
17278 } 17278 }
17279 if (texture->target() != target) { 17279 if (texture->target() != target) {
17280 LOCAL_SET_GL_ERROR( 17280 LOCAL_SET_GL_ERROR(
17281 GL_INVALID_OPERATION, 17281 GL_INVALID_OPERATION,
17282 "glConsumeTextureCHROMIUM", "invalid target"); 17282 "glConsumeTextureCHROMIUM", "invalid target");
17283 return; 17283 return;
17284 } 17284 }
17285 17285
17286 if (texture_ref->texture() == texture)
17287 return;
17288
17286 DeleteTexturesHelper(1, &client_id); 17289 DeleteTexturesHelper(1, &client_id);
17287 texture_ref = texture_manager()->Consume(client_id, texture); 17290 texture_ref = texture_manager()->Consume(client_id, texture);
17288 glBindTexture(target, texture_ref->service_id()); 17291 glBindTexture(target, texture_ref->service_id());
17289 17292
17290 TextureUnit& unit = state_.texture_units[state_.active_texture_unit]; 17293 TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
17291 unit.bind_target = target; 17294 unit.bind_target = target;
17292 unit.SetInfoForTarget(target, texture_ref); 17295 unit.SetInfoForTarget(target, texture_ref);
17293 } 17296 }
17294 17297
17295 void GLES2DecoderImpl::EnsureTextureForClientId( 17298 void GLES2DecoderImpl::EnsureTextureForClientId(
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
19251 } 19254 }
19252 19255
19253 // Include the auto-generated part of this file. We split this because it means 19256 // Include the auto-generated part of this file. We split this because it means
19254 // we can easily edit the non-auto generated parts right here in this file 19257 // we can easily edit the non-auto generated parts right here in this file
19255 // instead of having to edit some template or the code generator. 19258 // instead of having to edit some template or the code generator.
19256 #include "base/macros.h" 19259 #include "base/macros.h"
19257 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19260 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19258 19261
19259 } // namespace gles2 19262 } // namespace gles2
19260 } // namespace gpu 19263 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698