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