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