OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" | 5 #include "ui/ozone/platform/wayland/wayland_surface_factory.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <wayland-client.h> | 9 #include <wayland-client.h> |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return nullptr; | 163 return nullptr; |
164 return gl::InitializeGLSurface(new GLSurfaceWayland(std::move(egl_window))); | 164 return gl::InitializeGLSurface(new GLSurfaceWayland(std::move(egl_window))); |
165 #else | 165 #else |
166 return nullptr; | 166 return nullptr; |
167 #endif | 167 #endif |
168 } | 168 } |
169 | 169 |
170 scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateOffscreenGLSurface( | 170 scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateOffscreenGLSurface( |
171 const gfx::Size& size) { | 171 const gfx::Size& size) { |
172 #if defined(USE_WAYLAND_EGL) | 172 #if defined(USE_WAYLAND_EGL) |
173 return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); | 173 if (gl::GLSurfaceEGL::IsEGLSurfacelessContextSupported() && |
| 174 size.width() == 0 && size.height() == 0) { |
| 175 return gl::InitializeGLSurface(new gl::SurfacelessEGL(size)); |
| 176 } else { |
| 177 return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); |
| 178 } |
174 #else | 179 #else |
175 return nullptr; | 180 return nullptr; |
176 #endif | 181 #endif |
177 } | 182 } |
178 | 183 |
179 intptr_t GLOzoneEGLWayland::GetNativeDisplay() { | 184 intptr_t GLOzoneEGLWayland::GetNativeDisplay() { |
180 return reinterpret_cast<intptr_t>(connection_->display()); | 185 return reinterpret_cast<intptr_t>(connection_->display()); |
181 } | 186 } |
182 | 187 |
183 bool GLOzoneEGLWayland::LoadGLES2Bindings() { | 188 bool GLOzoneEGLWayland::LoadGLES2Bindings() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( | 242 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( |
238 gfx::AcceleratedWidget widget, | 243 gfx::AcceleratedWidget widget, |
239 gfx::Size size, | 244 gfx::Size size, |
240 gfx::BufferFormat format, | 245 gfx::BufferFormat format, |
241 const gfx::NativePixmapHandle& handle) { | 246 const gfx::NativePixmapHandle& handle) { |
242 NOTIMPLEMENTED(); | 247 NOTIMPLEMENTED(); |
243 return nullptr; | 248 return nullptr; |
244 } | 249 } |
245 | 250 |
246 } // namespace ui | 251 } // namespace ui |
OLD | NEW |