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

Side by Side Diff: ui/gl/scoped_cgl.h

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.cc ('k') | ui/gl/scoped_cgl.cc » ('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 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"
(...skipping 19 matching lines...) Expand all
30 static CGLPixelFormatObj Retain(CGLPixelFormatObj object) { 30 static CGLPixelFormatObj Retain(CGLPixelFormatObj object) {
31 return CGLRetainPixelFormat(object); 31 return CGLRetainPixelFormat(object);
32 } 32 }
33 static void Release(CGLPixelFormatObj object) { 33 static void Release(CGLPixelFormatObj object) {
34 CGLReleasePixelFormat(object); 34 CGLReleasePixelFormat(object);
35 } 35 }
36 }; 36 };
37 37
38 } // namespace base 38 } // namespace base
39 39
40 namespace gfx { 40 namespace gl {
41 41
42 class GL_EXPORT ScopedCGLSetCurrentContext { 42 class GL_EXPORT ScopedCGLSetCurrentContext {
43 public: 43 public:
44 explicit ScopedCGLSetCurrentContext(CGLContextObj context); 44 explicit ScopedCGLSetCurrentContext(CGLContextObj context);
45 ~ScopedCGLSetCurrentContext(); 45 ~ScopedCGLSetCurrentContext();
46 private: 46 private:
47 // Note that if a context is destroyed when it is current, then the current 47 // Note that if a context is destroyed when it is current, then the current
48 // context is changed to NULL. Take out a reference on |previous_context_| to 48 // context is changed to NULL. Take out a reference on |previous_context_| to
49 // preserve this behavior (when this falls out of scope, |previous_context_| 49 // preserve this behavior (when this falls out of scope, |previous_context_|
50 // 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
51 // release destroys the context). 51 // release destroys the context).
52 base::ScopedTypeRef<CGLContextObj> previous_context_; 52 base::ScopedTypeRef<CGLContextObj> previous_context_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(ScopedCGLSetCurrentContext); 54 DISALLOW_COPY_AND_ASSIGN(ScopedCGLSetCurrentContext);
55 }; 55 };
56 56
57 } // namespace gfx 57 } // namespace gl
58 58
59 #endif // UI_GL_SCOPED_CGL_H_ 59 #endif // UI_GL_SCOPED_CGL_H_
OLDNEW
« no previous file with comments | « ui/gl/scoped_binders.cc ('k') | ui/gl/scoped_cgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698