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_SURFACE_GLX_H_ | 5 #ifndef UI_GFX_GL_GL_SURFACE_GLX_H_ |
6 #define UI_GFX_GL_GL_SURFACE_GLX_H_ | 6 #define UI_GFX_GL_GL_SURFACE_GLX_H_ |
7 | 7 |
8 #include "ui/gfx/gl/gl_surface.h" | 8 #include "ui/gfx/gl/gl_surface.h" |
9 | 9 |
10 #include "ui/base/x/x11_util.h" | 10 #include "ui/base/x/x11_util.h" |
11 #include "ui/gfx/gl/gl_export.h" | 11 #include "ui/gfx/gl/gl_export.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 | 16 |
17 // Base class for GLX surfaces. | 17 // Base class for GLX surfaces. |
18 class GL_EXPORT GLSurfaceGLX : public GLSurface { | 18 class GL_EXPORT GLSurfaceGLX : public GLSurface { |
19 public: | 19 public: |
20 GLSurfaceGLX(); | 20 GLSurfaceGLX(); |
21 virtual ~GLSurfaceGLX(); | 21 virtual ~GLSurfaceGLX(); |
22 | 22 |
23 static bool InitializeOneOff(); | 23 static bool InitializeOneOff(); |
24 static Display* GetDisplay(); | |
25 | 24 |
26 // These aren't particularly tied to surfaces, but since we already | 25 // These aren't particularly tied to surfaces, but since we already |
27 // have the static InitializeOneOff here, it's easiest to reuse its | 26 // have the static InitializeOneOff here, it's easiest to reuse its |
28 // initialization guards. | 27 // initialization guards. |
29 static const char* GetGLXExtensions(); | 28 static const char* GetGLXExtensions(); |
30 static bool HasGLXExtension(const char* name); | 29 static bool HasGLXExtension(const char* name); |
31 static bool IsCreateContextRobustnessSupported(); | 30 static bool IsCreateContextRobustnessSupported(); |
32 | 31 |
| 32 virtual void* GetDisplay(); |
| 33 |
33 // Get the FB config that the surface was created with or NULL if it is not | 34 // Get the FB config that the surface was created with or NULL if it is not |
34 // a GLX drawable. | 35 // a GLX drawable. |
35 virtual void* GetConfig() = 0; | 36 virtual void* GetConfig() = 0; |
36 | 37 |
37 private: | 38 private: |
38 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); | 39 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); |
39 }; | 40 }; |
40 | 41 |
41 // A surface used to render to a view. | 42 // A surface used to render to a view. |
42 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { | 43 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 private: | 82 private: |
82 gfx::Size size_; | 83 gfx::Size size_; |
83 void* config_; | 84 void* config_; |
84 XID pbuffer_; | 85 XID pbuffer_; |
85 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); | 86 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace gfx | 89 } // namespace gfx |
89 | 90 |
90 #endif // UI_GFX_GL_GL_SURFACE_GLX_H_ | 91 #endif // UI_GFX_GL_GL_SURFACE_GLX_H_ |
OLD | NEW |