| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // initialization guards. | 65 // initialization guards. |
| 66 static const char* GetEGLExtensions(); | 66 static const char* GetEGLExtensions(); |
| 67 static bool HasEGLExtension(const char* name); | 67 static bool HasEGLExtension(const char* name); |
| 68 static bool IsCreateContextRobustnessSupported(); | 68 static bool IsCreateContextRobustnessSupported(); |
| 69 static bool IsEGLSurfacelessContextSupported(); | 69 static bool IsEGLSurfacelessContextSupported(); |
| 70 static bool IsDirectCompositionSupported(); | 70 static bool IsDirectCompositionSupported(); |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 ~GLSurfaceEGL() override; | 73 ~GLSurfaceEGL() override; |
| 74 | 74 |
| 75 EGLConfig config_; | 75 EGLConfig config_ = nullptr; |
| 76 GLSurface::Format format_; | 76 GLSurface::Format format_ = GLSurface::SURFACE_DEFAULT; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 79 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // Encapsulates an EGL surface bound to a view. | 82 // Encapsulates an EGL surface bound to a view. |
| 83 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 83 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
| 84 public: | 84 public: |
| 85 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); | 85 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); |
| 86 | 86 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 // SurfacelessEGL is used as Offscreen surface when platform supports | 183 // SurfacelessEGL is used as Offscreen surface when platform supports |
| 184 // KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the | 184 // KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the |
| 185 // need to create a dummy EGLsurface in case we render to client API targets. | 185 // need to create a dummy EGLsurface in case we render to client API targets. |
| 186 class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL { | 186 class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL { |
| 187 public: | 187 public: |
| 188 explicit SurfacelessEGL(const gfx::Size& size); | 188 explicit SurfacelessEGL(const gfx::Size& size); |
| 189 | 189 |
| 190 // Implement GLSurface. | 190 // Implement GLSurface. |
| 191 bool Initialize() override; |
| 191 bool Initialize(GLSurface::Format format) override; | 192 bool Initialize(GLSurface::Format format) override; |
| 192 void Destroy() override; | 193 void Destroy() override; |
| 193 bool IsOffscreen() override; | 194 bool IsOffscreen() override; |
| 194 bool IsSurfaceless() const override; | 195 bool IsSurfaceless() const override; |
| 195 gfx::SwapResult SwapBuffers() override; | 196 gfx::SwapResult SwapBuffers() override; |
| 196 gfx::Size GetSize() override; | 197 gfx::Size GetSize() override; |
| 197 bool Resize(const gfx::Size& size, | 198 bool Resize(const gfx::Size& size, |
| 198 float scale_factor, | 199 float scale_factor, |
| 199 bool has_alpha) override; | 200 bool has_alpha) override; |
| 200 EGLSurface GetHandle() override; | 201 EGLSurface GetHandle() override; |
| 201 void* GetShareHandle() override; | 202 void* GetShareHandle() override; |
| 202 | 203 |
| 203 protected: | 204 protected: |
| 204 ~SurfacelessEGL() override; | 205 ~SurfacelessEGL() override; |
| 205 | 206 |
| 206 private: | 207 private: |
| 207 gfx::Size size_; | 208 gfx::Size size_; |
| 208 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 209 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 209 }; | 210 }; |
| 210 | 211 |
| 211 } // namespace gfx | 212 } // namespace gfx |
| 212 | 213 |
| 213 #endif // UI_GL_GL_SURFACE_EGL_H_ | 214 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |