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