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

Side by Side Diff: ui/gl/scoped_binders.cc

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 | « ui/gl/scoped_binders.h ('k') | ui/gl/scoped_cgl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 gl {
11 11
12 ScopedFrameBufferBinder::ScopedFrameBufferBinder(unsigned int fbo) 12 ScopedFrameBufferBinder::ScopedFrameBufferBinder(unsigned int fbo)
13 : state_restorer_(!GLContext::GetCurrent() 13 : state_restorer_(!GLContext::GetCurrent()
14 ? NULL 14 ? NULL
15 : GLContext::GetCurrent()->GetGLStateRestorer()), 15 : GLContext::GetCurrent()->GetGLStateRestorer()),
16 old_fbo_(-1) { 16 old_fbo_(-1) {
17 if (!state_restorer_) 17 if (!state_restorer_)
18 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo_); 18 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo_);
19 glBindFramebufferEXT(GL_FRAMEBUFFER, fbo); 19 glBindFramebufferEXT(GL_FRAMEBUFFER, fbo);
20 } 20 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 ScopedCapability::~ScopedCapability() { 171 ScopedCapability::~ScopedCapability() {
172 if (enabled_ == GL_TRUE) { 172 if (enabled_ == GL_TRUE) {
173 glEnable(capability_); 173 glEnable(capability_);
174 } else { 174 } else {
175 glDisable(capability_); 175 glDisable(capability_);
176 } 176 }
177 } 177 }
178 178
179 } // namespace gfx 179 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/scoped_binders.h ('k') | ui/gl/scoped_cgl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698