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_GLX_H_ |
| 6 #define UI_GFX_GL_GL_CONTEXT_GLX_H_ |
5 #include <string> | 7 #include <string> |
6 | 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "ui/base/x/x11_util.h" | 10 #include "ui/base/x/x11_util.h" |
9 #include "ui/gfx/gl/gl_context.h" | 11 #include "ui/gfx/gl/gl_context.h" |
10 | 12 |
11 namespace gfx { | 13 namespace gfx { |
12 | 14 |
13 class GLSurface; | 15 class GLSurface; |
14 | 16 |
15 // Encapsulates a GLX OpenGL context. | 17 // Encapsulates a GLX OpenGL context. |
16 class GLContextGLX : public GLContext { | 18 class GLContextGLX : public GLContext { |
17 public: | 19 public: |
18 explicit GLContextGLX(GLShareGroup* share_group); | 20 explicit GLContextGLX(GLShareGroup* share_group); |
19 virtual ~GLContextGLX(); | 21 virtual ~GLContextGLX(); |
20 | 22 |
21 // Implement GLContext. | 23 // Implement GLContext. |
22 virtual bool Initialize( | 24 virtual bool Initialize( |
23 GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; | 25 GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; |
24 virtual void Destroy() OVERRIDE; | 26 virtual void Destroy() OVERRIDE; |
25 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; | 27 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; |
26 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; | 28 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; |
27 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; | 29 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; |
28 virtual void* GetHandle() OVERRIDE; | 30 virtual void* GetHandle() OVERRIDE; |
| 31 virtual Display* GetDisplay() OVERRIDE; |
29 virtual void SetSwapInterval(int interval) OVERRIDE; | 32 virtual void SetSwapInterval(int interval) OVERRIDE; |
30 virtual std::string GetExtensions() OVERRIDE; | 33 virtual std::string GetExtensions() OVERRIDE; |
31 virtual bool WasAllocatedUsingARBRobustness() OVERRIDE; | 34 virtual bool WasAllocatedUsingARBRobustness() OVERRIDE; |
32 | 35 |
33 private: | 36 private: |
34 void* context_; | 37 void* context_; |
35 Display* display_; | 38 Display* display_; |
36 | 39 |
37 DISALLOW_COPY_AND_ASSIGN(GLContextGLX); | 40 DISALLOW_COPY_AND_ASSIGN(GLContextGLX); |
38 }; | 41 }; |
39 | 42 |
40 } // namespace gfx | 43 } // namespace gfx |
| 44 |
| 45 #endif //UI_GFX_GL_GL_CONTEXT_GLX_H_ |
OLD | NEW |