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

Unified 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, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gl_scoped_binders.cc
diff --git a/content/common/gpu/gl_scoped_binders.cc b/content/common/gpu/gl_scoped_binders.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a75a0075c109f3811f43d33d2bcb8d0b8c49c3f7
--- /dev/null
+++ b/content/common/gpu/gl_scoped_binders.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/gpu/gl_scoped_binders.h"
+#include "ui/gl/gl_bindings.h"
+
+namespace content {
+
+ScopedFrameBufferBinder::ScopedFrameBufferBinder(unsigned int fbo) {
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo_);
+ glBindFramebufferEXT(GL_FRAMEBUFFER, fbo);
+}
+
+ScopedFrameBufferBinder::~ScopedFrameBufferBinder() {
+ glBindFramebufferEXT(GL_FRAMEBUFFER, old_fbo_);
+}
+
+ScopedTextureBinder::ScopedTextureBinder(unsigned int id) {
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_id_);
+ glBindTexture(GL_TEXTURE_2D, id);
+}
+
+ScopedTextureBinder::~ScopedTextureBinder() {
+ glBindTexture(GL_TEXTURE_2D, old_id_);
+}
+
+} // namespace content
« 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