OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_GL_GL_CONTEXT_H_ | 5 #ifndef UI_GFX_GL_GL_CONTEXT_H_ |
6 #define UI_GFX_GL_GL_CONTEXT_H_ | 6 #define UI_GFX_GL_GL_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "ui/gfx/gl/gl_share_group.h" | 13 #include "ui/gfx/gl/gl_share_group.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 | 16 |
17 class GLSurface; | 17 class GLSurface; |
18 | 18 |
19 // Encapsulates an OpenGL context, hiding platform specific management. | 19 // Encapsulates an OpenGL context, hiding platform specific management. |
20 class GL_EXPORT GLContext : public base::RefCounted<GLContext> { | 20 class GLContext : public base::RefCounted<GLContext> { |
21 public: | 21 public: |
22 explicit GLContext(GLShareGroup* share_group); | 22 explicit GLContext(GLShareGroup* share_group); |
23 | 23 |
24 // Initializes the GL context to be compatible with the given surface. The GL | 24 // Initializes the GL context to be compatible with the given surface. The GL |
25 // context can be made with other surface's of the same type. The compatible | 25 // context can be made with other surface's of the same type. The compatible |
26 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It | 26 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It |
27 // should be specific for all platforms though. | 27 // should be specific for all platforms though. |
28 virtual bool Initialize(GLSurface* compatible_surface) = 0; | 28 virtual bool Initialize(GLSurface* compatible_surface) = 0; |
29 | 29 |
30 // Destroys the GL context. | 30 // Destroys the GL context. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 private: | 72 private: |
73 scoped_refptr<GLShareGroup> share_group_; | 73 scoped_refptr<GLShareGroup> share_group_; |
74 friend class base::RefCounted<GLContext>; | 74 friend class base::RefCounted<GLContext>; |
75 DISALLOW_COPY_AND_ASSIGN(GLContext); | 75 DISALLOW_COPY_AND_ASSIGN(GLContext); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace gfx | 78 } // namespace gfx |
79 | 79 |
80 #endif // UI_GFX_GL_GL_CONTEXT_H_ | 80 #endif // UI_GFX_GL_GL_CONTEXT_H_ |
OLD | NEW |