| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/display.h" | 5 #include "components/exo/display.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 gfx::BufferFormat::RGBX_8888}; | 94 gfx::BufferFormat::RGBX_8888}; |
| 95 bool is_overlay_candidate = | 95 bool is_overlay_candidate = |
| 96 std::find(std::begin(kOverlayFormats), std::end(kOverlayFormats), | 96 std::find(std::begin(kOverlayFormats), std::end(kOverlayFormats), |
| 97 format) != std::end(kOverlayFormats); | 97 format) != std::end(kOverlayFormats); |
| 98 | 98 |
| 99 return base::MakeUnique<Buffer>( | 99 return base::MakeUnique<Buffer>( |
| 100 std::move(gpu_memory_buffer), GL_TEXTURE_EXTERNAL_OES, | 100 std::move(gpu_memory_buffer), GL_TEXTURE_EXTERNAL_OES, |
| 101 // COMMANDS_COMPLETED queries are required by native pixmaps. | 101 // COMMANDS_COMPLETED queries are required by native pixmaps. |
| 102 GL_COMMANDS_COMPLETED_CHROMIUM, use_zero_copy, is_overlay_candidate); | 102 GL_COMMANDS_COMPLETED_CHROMIUM, use_zero_copy, is_overlay_candidate); |
| 103 } | 103 } |
| 104 |
| 105 std::unique_ptr<gfx::GpuFence> Display::CreateLinuxFence(base::ScopedFD fd) { |
| 106 TRACE_EVENT1("exo", "Display::CreateLinuxFence", "fd", fd.get()); |
| 107 |
| 108 gfx::GpuFenceHandle handle; |
| 109 |
| 110 handle.fd.fd = fd.release(); |
| 111 |
| 112 std::unique_ptr<gfx::GpuFence> gpu_fence = |
| 113 aura::Env::GetInstance() |
| 114 ->context_factory() |
| 115 ->GetGpuMemoryBufferManager() |
| 116 ->CreateGpuFenceFromHandle(handle); |
| 117 |
| 118 return std::move(gpu_fence); |
| 119 } |
| 104 #endif | 120 #endif |
| 105 | 121 |
| 106 std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { | 122 std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { |
| 107 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", | 123 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", |
| 108 surface->AsTracedValue()); | 124 surface->AsTracedValue()); |
| 109 | 125 |
| 110 if (surface->HasSurfaceDelegate()) { | 126 if (surface->HasSurfaceDelegate()) { |
| 111 DLOG(ERROR) << "Surface has already been assigned a role"; | 127 DLOG(ERROR) << "Surface has already been assigned a role"; |
| 112 return nullptr; | 128 return nullptr; |
| 113 } | 129 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 notification_surface_manager_->GetSurface(notification_id)) { | 207 notification_surface_manager_->GetSurface(notification_id)) { |
| 192 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; | 208 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; |
| 193 return nullptr; | 209 return nullptr; |
| 194 } | 210 } |
| 195 | 211 |
| 196 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, | 212 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, |
| 197 surface, notification_id); | 213 surface, notification_id); |
| 198 } | 214 } |
| 199 | 215 |
| 200 } // namespace exo | 216 } // namespace exo |
| OLD | NEW |