Chromium Code Reviews| 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/common/shell_window_ids.h" | 10 #include "ash/common/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 gfx::GpuFenceHandle handle; | |
|
reveman
2016/10/12 19:20:19
nit: Please add "TRACE_EVENT1("exo", "Display::Cre
| |
| 107 | |
| 108 handle.fd.fd = fd.get(); | |
| 109 | |
| 110 std::unique_ptr<gfx::GpuFence> gpu_fence = | |
| 111 aura::Env::GetInstance() | |
| 112 ->context_factory() | |
| 113 ->GetGpuMemoryBufferManager() | |
| 114 ->CreateGpuFenceFromHandle(handle); | |
| 115 | |
| 116 return std::move(gpu_fence); | |
| 117 } | |
| 104 #endif | 118 #endif |
| 105 | 119 |
| 106 std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { | 120 std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) { |
| 107 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", | 121 TRACE_EVENT1("exo", "Display::CreateShellSurface", "surface", |
| 108 surface->AsTracedValue()); | 122 surface->AsTracedValue()); |
| 109 | 123 |
| 110 if (surface->HasSurfaceDelegate()) { | 124 if (surface->HasSurfaceDelegate()) { |
| 111 DLOG(ERROR) << "Surface has already been assigned a role"; | 125 DLOG(ERROR) << "Surface has already been assigned a role"; |
| 112 return nullptr; | 126 return nullptr; |
| 113 } | 127 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 notification_surface_manager_->GetSurface(notification_id)) { | 205 notification_surface_manager_->GetSurface(notification_id)) { |
| 192 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; | 206 DLOG(ERROR) << "Invalid notification id, id=" << notification_id; |
| 193 return nullptr; | 207 return nullptr; |
| 194 } | 208 } |
| 195 | 209 |
| 196 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, | 210 return base::MakeUnique<NotificationSurface>(notification_surface_manager_, |
| 197 surface, notification_id); | 211 surface, notification_id); |
| 198 } | 212 } |
| 199 | 213 |
| 200 } // namespace exo | 214 } // namespace exo |
| OLD | NEW |