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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 #include "ui/gl/gl_export.h" | 12 #include "ui/gl/gl_export.h" |
13 #include "ui/gl/gl_surface.h" | 13 #include "ui/gl/gl_surface.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 | 21 |
22 static bool InitializeOneOff(); | 22 static bool InitializeOneOff(); |
23 | 23 |
24 // These aren't particularly tied to surfaces, but since we already | 24 // These aren't particularly tied to surfaces, but since we already |
25 // have the static InitializeOneOff here, it's easiest to reuse its | 25 // have the static InitializeOneOff here, it's easiest to reuse its |
26 // initialization guards. | 26 // initialization guards. |
27 static const char* GetGLXExtensions(); | 27 static const char* GetGLXExtensions(); |
28 static bool HasGLXExtension(const char* name); | 28 static bool HasGLXExtension(const char* name); |
29 static bool IsCreateContextRobustnessSupported(); | 29 static bool IsCreateContextRobustnessSupported(); |
| 30 static bool IsOMLSyncControlSupported(); |
30 | 31 |
31 virtual void* GetDisplay() OVERRIDE; | 32 virtual void* GetDisplay() OVERRIDE; |
32 | 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 protected: | 38 protected: |
38 virtual ~GLSurfaceGLX(); | 39 virtual ~GLSurfaceGLX(); |
39 | 40 |
(...skipping 10 matching lines...) Expand all Loading... |
50 virtual bool Initialize() OVERRIDE; | 51 virtual bool Initialize() OVERRIDE; |
51 virtual void Destroy() OVERRIDE; | 52 virtual void Destroy() OVERRIDE; |
52 virtual bool Resize(const gfx::Size& size) OVERRIDE; | 53 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
53 virtual bool IsOffscreen() OVERRIDE; | 54 virtual bool IsOffscreen() OVERRIDE; |
54 virtual bool SwapBuffers() OVERRIDE; | 55 virtual bool SwapBuffers() OVERRIDE; |
55 virtual gfx::Size GetSize() OVERRIDE; | 56 virtual gfx::Size GetSize() OVERRIDE; |
56 virtual void* GetHandle() OVERRIDE; | 57 virtual void* GetHandle() OVERRIDE; |
57 virtual std::string GetExtensions() OVERRIDE; | 58 virtual std::string GetExtensions() OVERRIDE; |
58 virtual void* GetConfig() OVERRIDE; | 59 virtual void* GetConfig() OVERRIDE; |
59 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 60 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
| 61 virtual bool GetSyncValues(int64_t* systemTime, |
| 62 int64_t* mediaStreamCounter, |
| 63 int64_t* swapBufferCounter) OVERRIDE; |
60 | 64 |
61 protected: | 65 protected: |
62 NativeViewGLSurfaceGLX(); | 66 NativeViewGLSurfaceGLX(); |
63 virtual ~NativeViewGLSurfaceGLX(); | 67 virtual ~NativeViewGLSurfaceGLX(); |
64 | 68 |
65 gfx::AcceleratedWidget window_; | 69 gfx::AcceleratedWidget window_; |
66 | 70 |
67 private: | 71 private: |
68 void* config_; | 72 void* config_; |
69 gfx::Size size_; | 73 gfx::Size size_; |
(...skipping 22 matching lines...) Expand all Loading... |
92 gfx::Size size_; | 96 gfx::Size size_; |
93 void* config_; | 97 void* config_; |
94 XID pbuffer_; | 98 XID pbuffer_; |
95 | 99 |
96 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); | 100 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); |
97 }; | 101 }; |
98 | 102 |
99 } // namespace gfx | 103 } // namespace gfx |
100 | 104 |
101 #endif // UI_GL_GL_SURFACE_GLX_H_ | 105 #endif // UI_GL_GL_SURFACE_GLX_H_ |
OLD | NEW |