| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 pool_.reset(); | 96 pool_.reset(); |
| 97 } | 97 } |
| 98 size_ = viewport_size; | 98 size_ = viewport_size; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void WaylandCanvasSurface::PresentCanvas(const gfx::Rect& damage) { | 101 void WaylandCanvasSurface::PresentCanvas(const gfx::Rect& damage) { |
| 102 // TODO(forney): This is just a naive implementation that allows chromium to | 102 // TODO(forney): This is just a naive implementation that allows chromium to |
| 103 // draw to the buffer at any time, even if it is being used by the Wayland | 103 // draw to the buffer at any time, even if it is being used by the Wayland |
| 104 // compositor. Instead, we should track buffer releases and frame callbacks | 104 // compositor. Instead, we should track buffer releases and frame callbacks |
| 105 // from Wayland to ensure perfect frames (while minimizing copies). | 105 // from Wayland to ensure perfect frames (while minimizing copies). |
| 106 wl_surface* surface = window_->GetSurface(); | 106 wl_surface* surface = window_->surface(); |
| 107 wl_surface_damage(surface, damage.x(), damage.y(), damage.width(), | 107 wl_surface_damage(surface, damage.x(), damage.y(), damage.width(), |
| 108 damage.height()); | 108 damage.height()); |
| 109 wl_surface_attach(surface, buffer_.get(), 0, 0); | 109 wl_surface_attach(surface, buffer_.get(), 0, 0); |
| 110 wl_surface_commit(surface); | 110 wl_surface_commit(surface); |
| 111 display_->Flush(); | 111 display_->Flush(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 scoped_ptr<gfx::VSyncProvider> WaylandCanvasSurface::CreateVSyncProvider() { | 114 scoped_ptr<gfx::VSyncProvider> WaylandCanvasSurface::CreateVSyncProvider() { |
| 115 // TODO(forney): This can be implemented with information from frame | 115 // TODO(forney): This can be implemented with information from frame |
| 116 // callbacks, and possibly output refresh rate. | 116 // callbacks, and possibly output refresh rate. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return nullptr; | 159 return nullptr; |
| 160 } | 160 } |
| 161 | 161 |
| 162 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( | 162 scoped_refptr<NativePixmap> WaylandSurfaceFactory::CreateNativePixmapFromHandle( |
| 163 const gfx::NativePixmapHandle& handle) { | 163 const gfx::NativePixmapHandle& handle) { |
| 164 NOTIMPLEMENTED(); | 164 NOTIMPLEMENTED(); |
| 165 return nullptr; | 165 return nullptr; |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace ui | 168 } // namespace ui |
| OLD | NEW |