| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); | 165 return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); |
| 166 #else | 166 #else |
| 167 return nullptr; | 167 return nullptr; |
| 168 #endif | 168 #endif |
| 169 } | 169 } |
| 170 | 170 |
| 171 intptr_t WaylandSurfaceFactory::GetNativeDisplay() { | 171 intptr_t WaylandSurfaceFactory::GetNativeDisplay() { |
| 172 return reinterpret_cast<intptr_t>(connection_->display()); | 172 return reinterpret_cast<intptr_t>(connection_->display()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool WaylandSurfaceFactory::LoadEGLGLES2Bindings( | 175 bool WaylandSurfaceFactory::LoadEGLGLES2Bindings() { |
| 176 AddGLLibraryCallback add_gl_library, | |
| 177 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { | |
| 178 #if defined(USE_WAYLAND_EGL) | 176 #if defined(USE_WAYLAND_EGL) |
| 179 if (!connection_) | 177 if (!connection_) |
| 180 return false; | 178 return false; |
| 181 setenv("EGL_PLATFORM", "wayland", 0); | 179 setenv("EGL_PLATFORM", "wayland", 0); |
| 182 return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address); | 180 return LoadDefaultEGLGLES2Bindings(); |
| 183 #else | 181 #else |
| 184 return false; | 182 return false; |
| 185 #endif | 183 #endif |
| 186 } | 184 } |
| 187 | 185 |
| 188 std::unique_ptr<SurfaceOzoneCanvas> | 186 std::unique_ptr<SurfaceOzoneCanvas> |
| 189 WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) { | 187 WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) { |
| 190 WaylandWindow* window = connection_->GetWindow(widget); | 188 WaylandWindow* window = connection_->GetWindow(widget); |
| 191 DCHECK(window); | 189 DCHECK(window); |
| 192 return base::WrapUnique(new WaylandCanvasSurface(connection_, window)); | 190 return base::WrapUnique(new WaylandCanvasSurface(connection_, window)); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 204 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( | 202 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( |
| 205 gfx::AcceleratedWidget widget, | 203 gfx::AcceleratedWidget widget, |
| 206 gfx::Size size, | 204 gfx::Size size, |
| 207 gfx::BufferFormat format, | 205 gfx::BufferFormat format, |
| 208 const gfx::NativePixmapHandle& handle) { | 206 const gfx::NativePixmapHandle& handle) { |
| 209 NOTIMPLEMENTED(); | 207 NOTIMPLEMENTED(); |
| 210 return nullptr; | 208 return nullptr; |
| 211 } | 209 } |
| 212 | 210 |
| 213 } // namespace ui | 211 } // namespace ui |
| OLD | NEW |