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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Encapsulates an EGL surface bound to a view. | 53 // Encapsulates an EGL surface bound to a view. |
54 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 54 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
55 public: | 55 public: |
56 NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window); | 56 NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window); |
57 | 57 |
58 // Implement GLSurface. | 58 // Implement GLSurface. |
59 virtual EGLConfig GetConfig() OVERRIDE; | 59 virtual EGLConfig GetConfig() OVERRIDE; |
60 virtual bool Initialize() OVERRIDE; | 60 virtual bool Initialize() OVERRIDE; |
61 virtual void Destroy() OVERRIDE; | 61 virtual void Destroy() OVERRIDE; |
62 virtual bool Resize(const gfx::Size& size) OVERRIDE; | 62 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
| 63 virtual bool Recreate() OVERRIDE; |
63 virtual bool IsOffscreen() OVERRIDE; | 64 virtual bool IsOffscreen() OVERRIDE; |
64 virtual bool SwapBuffers() OVERRIDE; | 65 virtual bool SwapBuffers() OVERRIDE; |
65 virtual gfx::Size GetSize() OVERRIDE; | 66 virtual gfx::Size GetSize() OVERRIDE; |
66 virtual EGLSurface GetHandle() OVERRIDE; | 67 virtual EGLSurface GetHandle() OVERRIDE; |
67 virtual std::string GetExtensions() OVERRIDE; | 68 virtual std::string GetExtensions() OVERRIDE; |
68 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 69 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
69 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; | 70 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; |
| 71 virtual bool RecreateOnMakeCurrent() OVERRIDE; |
| 72 |
| 73 void SetRecreateOnMakeCurrent(bool recreate); |
70 | 74 |
71 protected: | 75 protected: |
72 virtual ~NativeViewGLSurfaceEGL(); | 76 virtual ~NativeViewGLSurfaceEGL(); |
73 void SetHandle(EGLSurface surface); | 77 void SetHandle(EGLSurface surface); |
74 | 78 |
75 private: | 79 private: |
76 gfx::AcceleratedWidget window_; | 80 gfx::AcceleratedWidget window_; |
77 EGLSurface surface_; | 81 EGLSurface surface_; |
78 bool supports_post_sub_buffer_; | 82 bool supports_post_sub_buffer_; |
79 EGLConfig config_; | 83 EGLConfig config_; |
| 84 bool recreate_on_make_current_; |
80 | 85 |
81 scoped_ptr<VSyncProvider> vsync_provider_; | 86 scoped_ptr<VSyncProvider> vsync_provider_; |
82 | 87 |
83 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); | 88 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); |
84 }; | 89 }; |
85 | 90 |
86 // Encapsulates a pbuffer EGL surface. | 91 // Encapsulates a pbuffer EGL surface. |
87 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { | 92 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { |
88 public: | 93 public: |
89 PbufferGLSurfaceEGL(bool software, const gfx::Size& size); | 94 PbufferGLSurfaceEGL(bool software, const gfx::Size& size); |
(...skipping 15 matching lines...) Expand all Loading... |
105 private: | 110 private: |
106 gfx::Size size_; | 111 gfx::Size size_; |
107 EGLSurface surface_; | 112 EGLSurface surface_; |
108 | 113 |
109 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); | 114 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); |
110 }; | 115 }; |
111 | 116 |
112 } // namespace gfx | 117 } // namespace gfx |
113 | 118 |
114 #endif // UI_GL_GL_SURFACE_EGL_H_ | 119 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |