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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static EGLDisplay InitializeDisplay(); | 58 static EGLDisplay InitializeDisplay(); |
59 static EGLNativeDisplayType GetNativeDisplay(); | 59 static EGLNativeDisplayType GetNativeDisplay(); |
60 | 60 |
61 // These aren't particularly tied to surfaces, but since we already | 61 // These aren't particularly tied to surfaces, but since we already |
62 // have the static InitializeOneOff here, it's easiest to reuse its | 62 // have the static InitializeOneOff here, it's easiest to reuse its |
63 // initialization guards. | 63 // initialization guards. |
64 static const char* GetEGLExtensions(); | 64 static const char* GetEGLExtensions(); |
65 static bool HasEGLExtension(const char* name); | 65 static bool HasEGLExtension(const char* name); |
66 static bool IsCreateContextRobustnessSupported(); | 66 static bool IsCreateContextRobustnessSupported(); |
67 static bool IsEGLSurfacelessContextSupported(); | 67 static bool IsEGLSurfacelessContextSupported(); |
| 68 static bool IsDirectCompositionSupported(); |
68 | 69 |
69 protected: | 70 protected: |
70 ~GLSurfaceEGL() override; | 71 ~GLSurfaceEGL() override; |
71 | 72 |
72 private: | 73 private: |
73 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 74 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
74 }; | 75 }; |
75 | 76 |
76 // Encapsulates an EGL surface bound to a view. | 77 // Encapsulates an EGL surface bound to a view. |
77 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 78 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
(...skipping 30 matching lines...) Expand all Loading... |
108 | 109 |
109 // Takes care of the platform dependant bits, of any, for creating the window. | 110 // Takes care of the platform dependant bits, of any, for creating the window. |
110 virtual bool InitializeNativeWindow(); | 111 virtual bool InitializeNativeWindow(); |
111 | 112 |
112 protected: | 113 protected: |
113 ~NativeViewGLSurfaceEGL() override; | 114 ~NativeViewGLSurfaceEGL() override; |
114 | 115 |
115 EGLNativeWindowType window_; | 116 EGLNativeWindowType window_; |
116 EGLConfig config_; | 117 EGLConfig config_; |
117 gfx::Size size_; | 118 gfx::Size size_; |
| 119 bool alpha_; |
| 120 bool enable_fixed_size_angle_; |
118 | 121 |
119 void OnSetSwapInterval(int interval) override; | 122 void OnSetSwapInterval(int interval) override; |
120 | 123 |
121 private: | 124 private: |
122 // Commit the |pending_overlays_| and clear the vector. Returns false if any | 125 // Commit the |pending_overlays_| and clear the vector. Returns false if any |
123 // fail to be committed. | 126 // fail to be committed. |
124 bool CommitAndClearPendingOverlays(); | 127 bool CommitAndClearPendingOverlays(); |
125 | 128 |
126 EGLSurface surface_; | 129 EGLSurface surface_; |
127 bool supports_post_sub_buffer_; | 130 bool supports_post_sub_buffer_; |
128 bool alpha_; | |
129 bool flips_vertically_; | 131 bool flips_vertically_; |
130 | 132 |
131 scoped_ptr<VSyncProvider> vsync_provider_; | 133 scoped_ptr<VSyncProvider> vsync_provider_; |
132 | 134 |
133 int swap_interval_; | 135 int swap_interval_; |
134 | 136 |
135 std::vector<GLSurfaceOverlay> pending_overlays_; | 137 std::vector<GLSurfaceOverlay> pending_overlays_; |
136 | 138 |
137 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
138 bool vsync_override_; | 140 bool vsync_override_; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 ~SurfacelessEGL() override; | 201 ~SurfacelessEGL() override; |
200 | 202 |
201 private: | 203 private: |
202 gfx::Size size_; | 204 gfx::Size size_; |
203 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 205 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
204 }; | 206 }; |
205 | 207 |
206 } // namespace gfx | 208 } // namespace gfx |
207 | 209 |
208 #endif // UI_GL_GL_SURFACE_EGL_H_ | 210 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |