OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/gpu/gl_scoped_binders.h" |
| 6 #include "ui/gl/gl_bindings.h" |
| 7 |
| 8 namespace content { |
| 9 |
| 10 ScopedFrameBufferBinder::ScopedFrameBufferBinder(unsigned int fbo) { |
| 11 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo_); |
| 12 glBindFramebufferEXT(GL_FRAMEBUFFER, fbo); |
| 13 } |
| 14 |
| 15 ScopedFrameBufferBinder::~ScopedFrameBufferBinder() { |
| 16 glBindFramebufferEXT(GL_FRAMEBUFFER, old_fbo_); |
| 17 } |
| 18 |
| 19 ScopedTextureBinder::ScopedTextureBinder(unsigned int id) { |
| 20 glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_id_); |
| 21 glBindTexture(GL_TEXTURE_2D, id); |
| 22 } |
| 23 |
| 24 ScopedTextureBinder::~ScopedTextureBinder() { |
| 25 glBindTexture(GL_TEXTURE_2D, old_id_); |
| 26 } |
| 27 |
| 28 } // namespace content |
OLD | NEW |