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

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

Issue 2104943003: Add a useful DCHECK to RestoreCurrentTextureBindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | 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 #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 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 : function_name_(function_name), 2289 : function_name_(function_name),
2290 error_state_(error_state) { 2290 error_state_(error_state) {
2291 ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state_, function_name_); 2291 ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state_, function_name_);
2292 } 2292 }
2293 2293
2294 ScopedGLErrorSuppressor::~ScopedGLErrorSuppressor() { 2294 ScopedGLErrorSuppressor::~ScopedGLErrorSuppressor() {
2295 ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state_, function_name_); 2295 ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state_, function_name_);
2296 } 2296 }
2297 2297
2298 static void RestoreCurrentTextureBindings(ContextState* state, GLenum target) { 2298 static void RestoreCurrentTextureBindings(ContextState* state, GLenum target) {
2299 DCHECK(!state->texture_units.empty());
2299 TextureUnit& info = state->texture_units[0]; 2300 TextureUnit& info = state->texture_units[0];
2300 GLuint last_id; 2301 GLuint last_id;
2301 scoped_refptr<TextureRef>& texture_ref = info.GetInfoForTarget(target); 2302 scoped_refptr<TextureRef>& texture_ref = info.GetInfoForTarget(target);
2302 if (texture_ref.get()) { 2303 if (texture_ref.get()) {
2303 last_id = texture_ref->service_id(); 2304 last_id = texture_ref->service_id();
2304 } else { 2305 } else {
2305 last_id = 0; 2306 last_id = 0;
2306 } 2307 }
2307 2308
2308 glBindTexture(target, last_id); 2309 glBindTexture(target, last_id);
(...skipping 14738 matching lines...) Expand 10 before | Expand all | Expand 10 after
17047 } 17048 }
17048 17049
17049 // Include the auto-generated part of this file. We split this because it means 17050 // Include the auto-generated part of this file. We split this because it means
17050 // we can easily edit the non-auto generated parts right here in this file 17051 // we can easily edit the non-auto generated parts right here in this file
17051 // instead of having to edit some template or the code generator. 17052 // instead of having to edit some template or the code generator.
17052 #include "base/macros.h" 17053 #include "base/macros.h"
17053 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17054 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17054 17055
17055 } // namespace gles2 17056 } // namespace gles2
17056 } // namespace gpu 17057 } // 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