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