OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef UI_GFX_GL_GL_CONTEXT_H_ | 5 #ifndef UI_GL_GL_CONTEXT_H_ |
6 #define UI_GFX_GL_GL_CONTEXT_H_ | 6 #define UI_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/gl/gl_share_group.h" |
14 #include "ui/gfx/gl/gpu_preference.h" | 14 #include "ui/gl/gpu_preference.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 | 17 |
18 class GLSurface; | 18 class GLSurface; |
19 | 19 |
20 // Encapsulates an OpenGL context, hiding platform specific management. | 20 // Encapsulates an OpenGL context, hiding platform specific management. |
21 class GL_EXPORT GLContext : public base::RefCounted<GLContext> { | 21 class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
22 public: | 22 public: |
23 explicit GLContext(GLShareGroup* share_group); | 23 explicit GLContext(GLShareGroup* share_group); |
24 | 24 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 protected: | 76 protected: |
77 virtual ~GLContext(); | 77 virtual ~GLContext(); |
78 static void SetCurrent(GLContext* context, GLSurface* surface); | 78 static void SetCurrent(GLContext* context, GLSurface* surface); |
79 | 79 |
80 // Initialize function pointers to extension functions in the GL | 80 // Initialize function pointers to extension functions in the GL |
81 // implementation. Should be called immediately after this context is made | 81 // implementation. Should be called immediately after this context is made |
82 // current. | 82 // current. |
83 bool InitializeExtensionBindings(); | 83 bool InitializeExtensionBindings(); |
84 | 84 |
85 private: | 85 private: |
| 86 friend class base::RefCounted<GLContext>; |
| 87 |
86 scoped_refptr<GLShareGroup> share_group_; | 88 scoped_refptr<GLShareGroup> share_group_; |
87 friend class base::RefCounted<GLContext>; | 89 |
88 DISALLOW_COPY_AND_ASSIGN(GLContext); | 90 DISALLOW_COPY_AND_ASSIGN(GLContext); |
89 }; | 91 }; |
90 | 92 |
91 } // namespace gfx | 93 } // namespace gfx |
92 | 94 |
93 #endif // UI_GFX_GL_GL_CONTEXT_H_ | 95 #endif // UI_GL_GL_CONTEXT_H_ |
OLD | NEW |