OLD | NEW |
1 // Copyright (c) 2012 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_GL_GL_SURFACE_GLX_H_ | 5 #ifndef UI_GL_GL_SURFACE_GLX_H_ |
6 #define UI_GL_GL_SURFACE_GLX_H_ | 6 #define UI_GL_GL_SURFACE_GLX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 void* GetDisplay() override; | 38 void* GetDisplay() override; |
39 | 39 |
40 // Get the FB config that the surface was created with or NULL if it is not | 40 // Get the FB config that the surface was created with or NULL if it is not |
41 // a GLX drawable. | 41 // a GLX drawable. |
42 void* GetConfig() override = 0; | 42 void* GetConfig() override = 0; |
43 | 43 |
44 protected: | 44 protected: |
45 ~GLSurfaceGLX() override; | 45 ~GLSurfaceGLX() override; |
46 | 46 |
| 47 static void* GetConfig(gfx::AcceleratedWidget window); |
| 48 |
47 private: | 49 private: |
48 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); | 50 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); |
49 }; | 51 }; |
50 | 52 |
51 // A surface used to render to a view. | 53 // A surface used to render to a view. |
52 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX, | 54 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX, |
53 public ui::PlatformEventDispatcher { | 55 public ui::PlatformEventDispatcher { |
54 public: | 56 public: |
55 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); | 57 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); |
56 | 58 |
(...skipping 29 matching lines...) Expand all Loading... |
86 | 88 |
87 void* config_; | 89 void* config_; |
88 gfx::Size size_; | 90 gfx::Size size_; |
89 | 91 |
90 scoped_ptr<VSyncProvider> vsync_provider_; | 92 scoped_ptr<VSyncProvider> vsync_provider_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); | 94 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); |
93 }; | 95 }; |
94 | 96 |
95 // A surface used to render to an offscreen pbuffer. | 97 // A surface used to render to an offscreen pbuffer. |
96 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { | 98 class GL_EXPORT UnmappedNativeViewGLSurfaceGLX : public GLSurfaceGLX { |
97 public: | 99 public: |
98 explicit PbufferGLSurfaceGLX(const gfx::Size& size); | 100 explicit UnmappedNativeViewGLSurfaceGLX(const gfx::Size& size); |
99 | 101 |
100 // Implement GLSurfaceGLX. | 102 // Implement GLSurfaceGLX. |
101 bool Initialize() override; | 103 bool Initialize() override; |
102 void Destroy() override; | 104 void Destroy() override; |
103 bool IsOffscreen() override; | 105 bool IsOffscreen() override; |
104 bool SwapBuffers() override; | 106 bool SwapBuffers() override; |
105 gfx::Size GetSize() override; | 107 gfx::Size GetSize() override; |
106 void* GetHandle() override; | 108 void* GetHandle() override; |
107 void* GetConfig() override; | 109 void* GetConfig() override; |
108 | 110 |
109 protected: | 111 protected: |
110 ~PbufferGLSurfaceGLX() override; | 112 ~UnmappedNativeViewGLSurfaceGLX() override; |
111 | 113 |
112 private: | 114 private: |
113 gfx::Size size_; | 115 gfx::Size size_; |
114 void* config_; | 116 void* config_; |
115 XID pbuffer_; | 117 // Unmapped dummy window, used to provide a compatible surface. |
| 118 gfx::AcceleratedWidget window_; |
116 | 119 |
117 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); | 120 DISALLOW_COPY_AND_ASSIGN(UnmappedNativeViewGLSurfaceGLX); |
118 }; | 121 }; |
119 | 122 |
120 } // namespace gfx | 123 } // namespace gfx |
121 | 124 |
122 #endif // UI_GL_GL_SURFACE_GLX_H_ | 125 #endif // UI_GL_GL_SURFACE_GLX_H_ |
OLD | NEW |