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 #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 Loading... |
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 |
OLD | NEW |