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

Side by Side Diff: content/common/gpu/gl_scoped_binders.cc

Issue 10827052: Extract Scoped{FrameBuffer,Texture}Binder and clean up TFP in VAVDA. (Closed) Base URL: https://git.chromium.org/git/chromium/src@master
Patch Set: Created 8 years, 4 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 | « content/common/gpu/gl_scoped_binders.h ('k') | content/common/gpu/media/vaapi_h264_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « content/common/gpu/gl_scoped_binders.h ('k') | content/common/gpu/media/vaapi_h264_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698