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 27 matching lines...) Expand all Loading... |
38 // These aren't particularly tied to surfaces, but since we already | 38 // These aren't particularly tied to surfaces, but since we already |
39 // have the static InitializeOneOff here, it's easiest to reuse its | 39 // have the static InitializeOneOff here, it's easiest to reuse its |
40 // initialization guards. | 40 // initialization guards. |
41 static const char* GetEGLExtensions(); | 41 static const char* GetEGLExtensions(); |
42 static bool HasEGLExtension(const char* name); | 42 static bool HasEGLExtension(const char* name); |
43 static bool IsCreateContextRobustnessSupported(); | 43 static bool IsCreateContextRobustnessSupported(); |
44 static bool IsEGLSurfacelessContextSupported(); | 44 static bool IsEGLSurfacelessContextSupported(); |
45 | 45 |
46 protected: | 46 protected: |
47 ~GLSurfaceEGL() override; | 47 ~GLSurfaceEGL() override; |
| 48 static void Deinitialize(); |
48 | 49 |
49 private: | 50 private: |
50 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
51 static EGLDisplay GetPlatformDisplay(EGLNativeDisplayType native_display); | 52 static EGLDisplay GetPlatformDisplay(EGLNativeDisplayType native_display); |
52 #endif | 53 #endif |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 55 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
55 }; | 56 }; |
56 | 57 |
57 // Encapsulates an EGL surface bound to a view. | 58 // Encapsulates an EGL surface bound to a view. |
(...skipping 17 matching lines...) Expand all Loading... |
75 | 76 |
76 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. | 77 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. |
77 // Takes ownership of the VSyncProvider. | 78 // Takes ownership of the VSyncProvider. |
78 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); | 79 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); |
79 | 80 |
80 protected: | 81 protected: |
81 ~NativeViewGLSurfaceEGL() override; | 82 ~NativeViewGLSurfaceEGL() override; |
82 | 83 |
83 EGLNativeWindowType window_; | 84 EGLNativeWindowType window_; |
84 | 85 |
85 virtual void SetSwapInterval(int interval) override; | 86 void SetSwapInterval(int interval) override; |
86 | 87 |
87 private: | 88 private: |
88 EGLSurface surface_; | 89 EGLSurface surface_; |
89 bool supports_post_sub_buffer_; | 90 bool supports_post_sub_buffer_; |
90 EGLConfig config_; | 91 EGLConfig config_; |
91 gfx::Size size_; | 92 gfx::Size size_; |
92 | 93 |
93 scoped_ptr<VSyncProvider> vsync_provider_; | 94 scoped_ptr<VSyncProvider> vsync_provider_; |
94 | 95 |
95 int swap_interval_; | 96 int swap_interval_; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 ~SurfacelessEGL() override; | 149 ~SurfacelessEGL() override; |
149 | 150 |
150 private: | 151 private: |
151 gfx::Size size_; | 152 gfx::Size size_; |
152 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 153 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
153 }; | 154 }; |
154 | 155 |
155 } // namespace gfx | 156 } // namespace gfx |
156 | 157 |
157 #endif // UI_GL_GL_SURFACE_EGL_H_ | 158 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |