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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 protected: | 104 protected: |
105 virtual ~PbufferGLSurfaceEGL(); | 105 virtual ~PbufferGLSurfaceEGL(); |
106 | 106 |
107 private: | 107 private: |
108 gfx::Size size_; | 108 gfx::Size size_; |
109 EGLSurface surface_; | 109 EGLSurface surface_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); | 111 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); |
112 }; | 112 }; |
113 | 113 |
| 114 // SurfacelessEGL is used as Offscreen surface when platform supports |
| 115 // KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the |
| 116 // need to create a dummy EGLsurface in case we render to client API targets. |
| 117 class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL { |
| 118 public: |
| 119 explicit SurfacelessEGL(const gfx::Size& size); |
| 120 |
| 121 // Implement GLSurface. |
| 122 virtual EGLConfig GetConfig() OVERRIDE; |
| 123 virtual bool Initialize() OVERRIDE; |
| 124 virtual void Destroy() OVERRIDE; |
| 125 virtual bool IsOffscreen() OVERRIDE; |
| 126 virtual bool SwapBuffers() OVERRIDE; |
| 127 virtual gfx::Size GetSize() OVERRIDE; |
| 128 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
| 129 virtual EGLSurface GetHandle() OVERRIDE; |
| 130 virtual void* GetShareHandle() OVERRIDE; |
| 131 |
| 132 protected: |
| 133 virtual ~SurfacelessEGL(); |
| 134 |
| 135 private: |
| 136 gfx::Size size_; |
| 137 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 138 }; |
| 139 |
114 } // namespace gfx | 140 } // namespace gfx |
115 | 141 |
116 #endif // UI_GL_GL_SURFACE_EGL_H_ | 142 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |