OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
Avi (use Gerrit)
2014/02/07 01:45:29
No (c). It's 2014.
ccameron
2014/02/07 06:57:49
Done.
| |
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 "base/logging.h" | |
6 #include "ui/gl/cgl_util.h" | |
7 | |
8 namespace gfx { | |
9 | |
10 ScopedCGLSetCurrentContext::ScopedCGLSetCurrentContext(CGLContextObj context) | |
11 : previous_context_(CGLGetCurrentContext(), base::scoped_policy::RETAIN) { | |
12 CGLError error = CGLSetCurrentContext(context); | |
13 DCHECK_EQ(error, kCGLNoError) << "CGLSetCurrentContext should never fail"; | |
14 } | |
15 | |
16 ScopedCGLSetCurrentContext::~ScopedCGLSetCurrentContext() { | |
17 CGLError error = CGLSetCurrentContext(previous_context_); | |
18 DCHECK_EQ(error, kCGLNoError) << "CGLSetCurrentContext should never fail"; | |
19 } | |
20 | |
21 } // namespace gfx | |
OLD | NEW |