Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 switch (target) { | 40 switch (target) { |
| 41 case GL_TEXTURE_2D: | 41 case GL_TEXTURE_2D: |
| 42 target_getter = GL_TEXTURE_BINDING_2D; | 42 target_getter = GL_TEXTURE_BINDING_2D; |
| 43 break; | 43 break; |
| 44 case GL_TEXTURE_CUBE_MAP: | 44 case GL_TEXTURE_CUBE_MAP: |
| 45 target_getter = GL_TEXTURE_BINDING_CUBE_MAP; | 45 target_getter = GL_TEXTURE_BINDING_CUBE_MAP; |
| 46 break; | 46 break; |
| 47 case GL_TEXTURE_EXTERNAL_OES: | 47 case GL_TEXTURE_EXTERNAL_OES: |
| 48 target_getter = GL_TEXTURE_BINDING_EXTERNAL_OES; | 48 target_getter = GL_TEXTURE_BINDING_EXTERNAL_OES; |
| 49 break; | 49 break; |
| 50 case GL_TEXTURE_RECTANGLE_ARB: | |
| 51 target_getter = GL_TEXTURE_BINDING_RECTANGLE_ARB; | |
| 52 break; | |
| 50 default: | 53 default: |
| 51 NOTIMPLEMENTED() << "Target not part of OpenGL ES 2.0 spec."; | 54 NOTIMPLEMENTED() << " Target not part of OpenGL ES 2.0 spec."; |
|
reveman
2015/10/27 19:31:54
why the space here? also I'm not sure this is accu
Daniele Castagna
2015/10/29 20:09:05
Fixed the string.
The added space is because NOTIM
| |
| 52 } | 55 } |
| 53 glGetIntegerv(target_getter, &old_id_); | 56 glGetIntegerv(target_getter, &old_id_); |
| 54 } | 57 } |
| 55 glBindTexture(target_, id); | 58 glBindTexture(target_, id); |
| 56 } | 59 } |
| 57 | 60 |
| 58 ScopedTextureBinder::~ScopedTextureBinder() { | 61 ScopedTextureBinder::~ScopedTextureBinder() { |
| 59 if (state_restorer_) { | 62 if (state_restorer_) { |
| 60 DCHECK(!!GLContext::GetCurrent()); | 63 DCHECK(!!GLContext::GetCurrent()); |
| 61 DCHECK_EQ(state_restorer_, GLContext::GetCurrent()->GetGLStateRestorer()); | 64 DCHECK_EQ(state_restorer_, GLContext::GetCurrent()->GetGLStateRestorer()); |
| 62 state_restorer_->RestoreActiveTextureUnitBinding(target_); | 65 state_restorer_->RestoreActiveTextureUnitBinding(target_); |
| 63 } else { | 66 } else { |
| 64 glBindTexture(target_, old_id_); | 67 glBindTexture(target_, old_id_); |
| 65 } | 68 } |
| 66 } | 69 } |
| 67 | 70 |
| 68 } // namespace gfx | 71 } // namespace gfx |
| OLD | NEW |