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

Side by Side Diff: ui/gl/scoped_binders.cc

Issue 205843002: GPU: Only restore one texture unit in ScopedTextureBinder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mock. Created 6 years, 9 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 | « ui/gl/gl_state_restorer.h ('k') | 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 "ui/gl/scoped_binders.h" 5 #include "ui/gl/scoped_binders.h"
6 #include "ui/gl/gl_bindings.h" 6 #include "ui/gl/gl_bindings.h"
7 #include "ui/gl/gl_context.h" 7 #include "ui/gl/gl_context.h"
8 #include "ui/gl/gl_state_restorer.h" 8 #include "ui/gl/gl_state_restorer.h"
9 9
10 namespace gfx { 10 namespace gfx {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 glGetIntegerv(target_getter, &old_id_); 53 glGetIntegerv(target_getter, &old_id_);
54 } 54 }
55 glBindTexture(target_, id); 55 glBindTexture(target_, id);
56 } 56 }
57 57
58 ScopedTextureBinder::~ScopedTextureBinder() { 58 ScopedTextureBinder::~ScopedTextureBinder() {
59 if (state_restorer_) { 59 if (state_restorer_) {
60 DCHECK(!!GLContext::GetCurrent()); 60 DCHECK(!!GLContext::GetCurrent());
61 DCHECK_EQ(state_restorer_, GLContext::GetCurrent()->GetGLStateRestorer()); 61 DCHECK_EQ(state_restorer_, GLContext::GetCurrent()->GetGLStateRestorer());
62 state_restorer_->RestoreAllTextureUnitBindings(); 62 state_restorer_->RestoreActiveTextureUnitBinding(target_);
63 } else { 63 } else {
64 glBindTexture(target_, old_id_); 64 glBindTexture(target_, old_id_);
65 } 65 }
66 } 66 }
67 67
68 } // namespace gfx 68 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_state_restorer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698