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_EGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_EGL_H_ |
6 #define UI_GL_GL_SURFACE_EGL_H_ | 6 #define UI_GL_GL_SURFACE_EGL_H_ |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
33 static EGLDisplay GetHardwareDisplay(); | 33 static EGLDisplay GetHardwareDisplay(); |
34 static EGLDisplay GetSoftwareDisplay(); | 34 static EGLDisplay GetSoftwareDisplay(); |
35 static EGLNativeDisplayType GetNativeDisplay(); | 35 static EGLNativeDisplayType GetNativeDisplay(); |
36 | 36 |
37 // These aren't particularly tied to surfaces, but since we already | 37 // These aren't particularly tied to surfaces, but since we already |
38 // have the static InitializeOneOff here, it's easiest to reuse its | 38 // have the static InitializeOneOff here, it's easiest to reuse its |
39 // initialization guards. | 39 // initialization guards. |
40 static const char* GetEGLExtensions(); | 40 static const char* GetEGLExtensions(); |
41 static bool HasEGLExtension(const char* name); | 41 static bool HasEGLExtension(const char* name); |
42 static bool IsCreateContextRobustnessSupported(); | 42 static bool IsCreateContextRobustnessSupported(); |
| 43 static bool IsSyncControlSupported(); |
43 | 44 |
44 protected: | 45 protected: |
45 virtual ~GLSurfaceEGL(); | 46 virtual ~GLSurfaceEGL(); |
46 | 47 |
47 bool software_; | 48 bool software_; |
48 | 49 |
49 private: | 50 private: |
50 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 51 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
51 }; | 52 }; |
52 | 53 |
53 // Encapsulates an EGL surface bound to a view. | 54 // Encapsulates an EGL surface bound to a view. |
54 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 55 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
55 public: | 56 public: |
56 NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window); | 57 NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window); |
57 | 58 |
58 // Implement GLSurface. | 59 // Implement GLSurface. |
59 virtual EGLConfig GetConfig() OVERRIDE; | 60 virtual EGLConfig GetConfig() OVERRIDE; |
60 virtual bool Initialize() OVERRIDE; | 61 virtual bool Initialize() OVERRIDE; |
| 62 virtual bool Initialize(VSyncProvider* syncProvider) OVERRIDE; |
61 virtual void Destroy() OVERRIDE; | 63 virtual void Destroy() OVERRIDE; |
62 virtual bool Resize(const gfx::Size& size) OVERRIDE; | 64 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
63 virtual bool Recreate() OVERRIDE; | 65 virtual bool Recreate() OVERRIDE; |
64 virtual bool IsOffscreen() OVERRIDE; | 66 virtual bool IsOffscreen() OVERRIDE; |
65 virtual bool SwapBuffers() OVERRIDE; | 67 virtual bool SwapBuffers() OVERRIDE; |
66 virtual gfx::Size GetSize() OVERRIDE; | 68 virtual gfx::Size GetSize() OVERRIDE; |
67 virtual EGLSurface GetHandle() OVERRIDE; | 69 virtual EGLSurface GetHandle() OVERRIDE; |
68 virtual std::string GetExtensions() OVERRIDE; | 70 virtual std::string GetExtensions() OVERRIDE; |
69 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 71 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
70 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; | 72 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; |
71 | 73 |
| 74 |
72 protected: | 75 protected: |
73 virtual ~NativeViewGLSurfaceEGL(); | 76 virtual ~NativeViewGLSurfaceEGL(); |
74 void SetHandle(EGLSurface surface); | 77 void SetHandle(EGLSurface surface); |
75 | 78 |
76 private: | 79 private: |
77 gfx::AcceleratedWidget window_; | 80 gfx::AcceleratedWidget window_; |
78 EGLSurface surface_; | 81 EGLSurface surface_; |
79 bool supports_post_sub_buffer_; | 82 bool supports_post_sub_buffer_; |
80 EGLConfig config_; | 83 EGLConfig config_; |
81 | 84 |
(...skipping 24 matching lines...) Expand all Loading... |
106 private: | 109 private: |
107 gfx::Size size_; | 110 gfx::Size size_; |
108 EGLSurface surface_; | 111 EGLSurface surface_; |
109 | 112 |
110 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); | 113 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); |
111 }; | 114 }; |
112 | 115 |
113 } // namespace gfx | 116 } // namespace gfx |
114 | 117 |
115 #endif // UI_GL_GL_SURFACE_EGL_H_ | 118 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |