| 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 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_; |
| 75 GLSurface::Format format_; | |
| 76 | 75 |
| 77 private: | 76 private: |
| 78 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 77 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 // Encapsulates an EGL surface bound to a view. | 80 // Encapsulates an EGL surface bound to a view. |
| 82 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 81 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
| 83 public: | 82 public: |
| 84 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); | 83 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); |
| 85 | 84 |
| 86 // Implement GLSurface. | 85 // Implement GLSurface. |
| 87 bool Initialize() override; | 86 using GLSurfaceEGL::Initialize; |
| 88 bool Initialize(GLSurface::Format format) override; | 87 bool Initialize(GLSurface::Format format) override; |
| 89 void Destroy() override; | 88 void Destroy() override; |
| 90 bool Resize(const gfx::Size& size, | 89 bool Resize(const gfx::Size& size, |
| 91 float scale_factor, | 90 float scale_factor, |
| 92 bool has_alpha) override; | 91 bool has_alpha) override; |
| 93 bool Recreate() override; | 92 bool Recreate() override; |
| 94 bool IsOffscreen() override; | 93 bool IsOffscreen() override; |
| 95 gfx::SwapResult SwapBuffers() override; | 94 gfx::SwapResult SwapBuffers() override; |
| 96 gfx::Size GetSize() override; | 95 gfx::Size GetSize() override; |
| 97 EGLSurface GetHandle() override; | 96 EGLSurface GetHandle() override; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 149 |
| 151 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); | 150 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); |
| 152 }; | 151 }; |
| 153 | 152 |
| 154 // Encapsulates a pbuffer EGL surface. | 153 // Encapsulates a pbuffer EGL surface. |
| 155 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { | 154 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { |
| 156 public: | 155 public: |
| 157 explicit PbufferGLSurfaceEGL(const gfx::Size& size); | 156 explicit PbufferGLSurfaceEGL(const gfx::Size& size); |
| 158 | 157 |
| 159 // Implement GLSurface. | 158 // Implement GLSurface. |
| 159 bool Initialize() override; |
| 160 bool Initialize(GLSurface::Format format) override; | 160 bool Initialize(GLSurface::Format format) override; |
| 161 void Destroy() override; | 161 void Destroy() override; |
| 162 bool IsOffscreen() override; | 162 bool IsOffscreen() override; |
| 163 gfx::SwapResult SwapBuffers() override; | 163 gfx::SwapResult SwapBuffers() override; |
| 164 gfx::Size GetSize() override; | 164 gfx::Size GetSize() override; |
| 165 bool Resize(const gfx::Size& size, | 165 bool Resize(const gfx::Size& size, |
| 166 float scale_factor, | 166 float scale_factor, |
| 167 bool has_alpha) override; | 167 bool has_alpha) override; |
| 168 EGLSurface GetHandle() override; | 168 EGLSurface GetHandle() override; |
| 169 void* GetShareHandle() override; | 169 void* GetShareHandle() override; |
| (...skipping 32 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 |