| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_GL_SCOPED_CGL_H_ | 5 #ifndef UI_GL_SCOPED_CGL_H_ |
| 6 #define UI_GL_SCOPED_CGL_H_ | 6 #define UI_GL_SCOPED_CGL_H_ |
| 7 | 7 |
| 8 #include <OpenGL/OpenGL.h> | 8 #include <OpenGL/OpenGL.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_typeref.h" | 10 #include "base/mac/scoped_typeref.h" |
| 11 #include "base/macros.h" |
| 11 #include "ui/gl/gl_export.h" | 12 #include "ui/gl/gl_export.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 | 15 |
| 15 template<> | 16 template<> |
| 16 struct ScopedTypeRefTraits<CGLContextObj> { | 17 struct ScopedTypeRefTraits<CGLContextObj> { |
| 17 static CGLContextObj InvalidValue() { return nullptr; } | 18 static CGLContextObj InvalidValue() { return nullptr; } |
| 18 static void Retain(CGLContextObj object) { | 19 static void Retain(CGLContextObj object) { |
| 19 CGLRetainContext(object); | 20 CGLRetainContext(object); |
| 20 } | 21 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 // will be made current, then released, so NULL will be current if that | 50 // will be made current, then released, so NULL will be current if that |
| 50 // release destroys the context). | 51 // release destroys the context). |
| 51 base::ScopedTypeRef<CGLContextObj> previous_context_; | 52 base::ScopedTypeRef<CGLContextObj> previous_context_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(ScopedCGLSetCurrentContext); | 54 DISALLOW_COPY_AND_ASSIGN(ScopedCGLSetCurrentContext); |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace gfx | 57 } // namespace gfx |
| 57 | 58 |
| 58 #endif // UI_GL_SCOPED_CGL_H_ | 59 #endif // UI_GL_SCOPED_CGL_H_ |
| OLD | NEW |