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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 std::vector<DisplayType>* init_displays); | 46 std::vector<DisplayType>* init_displays); |
47 | 47 |
48 // Interface for EGL surface. | 48 // Interface for EGL surface. |
49 class GL_EXPORT GLSurfaceEGL : public GLSurface { | 49 class GL_EXPORT GLSurfaceEGL : public GLSurface { |
50 public: | 50 public: |
51 GLSurfaceEGL(); | 51 GLSurfaceEGL(); |
52 | 52 |
53 // Implement GLSurface. | 53 // Implement GLSurface. |
54 EGLDisplay GetDisplay() override; | 54 EGLDisplay GetDisplay() override; |
55 EGLConfig GetConfig() override; | 55 EGLConfig GetConfig() override; |
| 56 GLSurface::Format GetDefaultFormat() const override; |
56 | 57 |
57 static bool InitializeOneOff(); | 58 static bool InitializeOneOff(); |
58 static EGLDisplay GetHardwareDisplay(); | 59 static EGLDisplay GetHardwareDisplay(); |
59 static EGLDisplay InitializeDisplay(); | 60 static EGLDisplay InitializeDisplay(); |
60 static EGLNativeDisplayType GetNativeDisplay(); | 61 static EGLNativeDisplayType GetNativeDisplay(); |
61 | 62 |
62 // These aren't particularly tied to surfaces, but since we already | 63 // These aren't particularly tied to surfaces, but since we already |
63 // have the static InitializeOneOff here, it's easiest to reuse its | 64 // have the static InitializeOneOff here, it's easiest to reuse its |
64 // initialization guards. | 65 // initialization guards. |
65 static const char* GetEGLExtensions(); | 66 static const char* GetEGLExtensions(); |
66 static bool HasEGLExtension(const char* name); | 67 static bool HasEGLExtension(const char* name); |
67 static bool IsCreateContextRobustnessSupported(); | 68 static bool IsCreateContextRobustnessSupported(); |
68 static bool IsEGLSurfacelessContextSupported(); | 69 static bool IsEGLSurfacelessContextSupported(); |
69 static bool IsDirectCompositionSupported(); | 70 static bool IsDirectCompositionSupported(); |
70 | 71 |
71 protected: | 72 protected: |
72 ~GLSurfaceEGL() override; | 73 ~GLSurfaceEGL() override; |
73 | 74 |
74 EGLConfig config_; | 75 EGLConfig config_; |
75 GLSurface::Format format_; | |
76 | 76 |
77 private: | 77 private: |
78 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 78 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
79 }; | 79 }; |
80 | 80 |
81 // Encapsulates an EGL surface bound to a view. | 81 // Encapsulates an EGL surface bound to a view. |
82 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 82 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
83 public: | 83 public: |
84 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); | 84 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); |
85 | 85 |
86 // Implement GLSurface. | 86 // Implement GLSurface. |
87 bool Initialize() override; | 87 using GLSurface::Initialize; |
88 bool Initialize(GLSurface::Format format) override; | 88 bool Initialize(GLSurface::Format format) override; |
89 void Destroy() override; | 89 void Destroy() override; |
90 bool Resize(const gfx::Size& size, | 90 bool Resize(const gfx::Size& size, |
91 float scale_factor, | 91 float scale_factor, |
92 bool has_alpha) override; | 92 bool has_alpha) override; |
93 bool Recreate() override; | 93 bool Recreate() override; |
94 bool IsOffscreen() override; | 94 bool IsOffscreen() override; |
95 gfx::SwapResult SwapBuffers() override; | 95 gfx::SwapResult SwapBuffers() override; |
96 gfx::Size GetSize() override; | 96 gfx::Size GetSize() override; |
97 EGLSurface GetHandle() override; | 97 EGLSurface GetHandle() override; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 ~SurfacelessEGL() override; | 202 ~SurfacelessEGL() override; |
203 | 203 |
204 private: | 204 private: |
205 gfx::Size size_; | 205 gfx::Size size_; |
206 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 206 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
207 }; | 207 }; |
208 | 208 |
209 } // namespace gfx | 209 } // namespace gfx |
210 | 210 |
211 #endif // UI_GL_GL_SURFACE_EGL_H_ | 211 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |