Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: ui/gl/gl_surface_egl.h

Issue 1420503011: GLES2CmdDecoder should resize GLSurface using GLSurface::Resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface.cc ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Encapsulates an EGL surface bound to a view. 70 // Encapsulates an EGL surface bound to a view.
71 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { 71 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL {
72 public: 72 public:
73 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); 73 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window);
74 74
75 // Implement GLSurface. 75 // Implement GLSurface.
76 EGLConfig GetConfig() override; 76 EGLConfig GetConfig() override;
77 bool Initialize() override; 77 bool Initialize() override;
78 void Destroy() override; 78 void Destroy() override;
79 bool Resize(const gfx::Size& size) override; 79 bool Resize(const gfx::Size& size, float scale_factor) override;
80 bool Recreate() override; 80 bool Recreate() override;
81 bool IsOffscreen() override; 81 bool IsOffscreen() override;
82 gfx::SwapResult SwapBuffers() override; 82 gfx::SwapResult SwapBuffers() override;
83 gfx::Size GetSize() override; 83 gfx::Size GetSize() override;
84 EGLSurface GetHandle() override; 84 EGLSurface GetHandle() override;
85 bool SupportsPostSubBuffer() override; 85 bool SupportsPostSubBuffer() override;
86 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; 86 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
87 VSyncProvider* GetVSyncProvider() override; 87 VSyncProvider* GetVSyncProvider() override;
88 88
89 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. 89 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 public: 124 public:
125 explicit PbufferGLSurfaceEGL(const gfx::Size& size); 125 explicit PbufferGLSurfaceEGL(const gfx::Size& size);
126 126
127 // Implement GLSurface. 127 // Implement GLSurface.
128 EGLConfig GetConfig() override; 128 EGLConfig GetConfig() override;
129 bool Initialize() override; 129 bool Initialize() override;
130 void Destroy() override; 130 void Destroy() override;
131 bool IsOffscreen() override; 131 bool IsOffscreen() override;
132 gfx::SwapResult SwapBuffers() override; 132 gfx::SwapResult SwapBuffers() override;
133 gfx::Size GetSize() override; 133 gfx::Size GetSize() override;
134 bool Resize(const gfx::Size& size) override; 134 bool Resize(const gfx::Size& size, float scale_factor) override;
135 EGLSurface GetHandle() override; 135 EGLSurface GetHandle() override;
136 void* GetShareHandle() override; 136 void* GetShareHandle() override;
137 137
138 protected: 138 protected:
139 ~PbufferGLSurfaceEGL() override; 139 ~PbufferGLSurfaceEGL() override;
140 140
141 private: 141 private:
142 gfx::Size size_; 142 gfx::Size size_;
143 EGLSurface surface_; 143 EGLSurface surface_;
144 144
145 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL); 145 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceEGL);
146 }; 146 };
147 147
148 // SurfacelessEGL is used as Offscreen surface when platform supports 148 // SurfacelessEGL is used as Offscreen surface when platform supports
149 // KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the 149 // KHR_surfaceless_context and GL_OES_surfaceless_context. This would avoid the
150 // need to create a dummy EGLsurface in case we render to client API targets. 150 // need to create a dummy EGLsurface in case we render to client API targets.
151 class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL { 151 class GL_EXPORT SurfacelessEGL : public GLSurfaceEGL {
152 public: 152 public:
153 explicit SurfacelessEGL(const gfx::Size& size); 153 explicit SurfacelessEGL(const gfx::Size& size);
154 154
155 // Implement GLSurface. 155 // Implement GLSurface.
156 EGLConfig GetConfig() override; 156 EGLConfig GetConfig() override;
157 bool Initialize() override; 157 bool Initialize() override;
158 void Destroy() override; 158 void Destroy() override;
159 bool IsOffscreen() override; 159 bool IsOffscreen() override;
160 bool IsSurfaceless() const override; 160 bool IsSurfaceless() const override;
161 gfx::SwapResult SwapBuffers() override; 161 gfx::SwapResult SwapBuffers() override;
162 gfx::Size GetSize() override; 162 gfx::Size GetSize() override;
163 bool Resize(const gfx::Size& size) override; 163 bool Resize(const gfx::Size& size, float scale_factor) override;
164 EGLSurface GetHandle() override; 164 EGLSurface GetHandle() override;
165 void* GetShareHandle() override; 165 void* GetShareHandle() override;
166 166
167 protected: 167 protected:
168 ~SurfacelessEGL() override; 168 ~SurfacelessEGL() override;
169 169
170 private: 170 private:
171 gfx::Size size_; 171 gfx::Size size_;
172 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); 172 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL);
173 }; 173 };
174 174
175 } // namespace gfx 175 } // namespace gfx
176 176
177 #endif // UI_GL_GL_SURFACE_EGL_H_ 177 #endif // UI_GL_GL_SURFACE_EGL_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_surface.cc ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698