| 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/drm/gpu/gbm_surfaceless.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/task_scheduler/post_task.h" | 12 #include "base/threading/worker_pool.h" |
| 13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
| 14 #include "ui/ozone/common/egl_util.h" | 14 #include "ui/ozone/common/egl_util.h" |
| 15 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h" | 15 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h" |
| 16 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 16 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| 17 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" | 17 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
| 18 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 18 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return; | 124 return; |
| 125 } | 125 } |
| 126 | 126 |
| 127 base::Closure fence_wait_task = | 127 base::Closure fence_wait_task = |
| 128 base::Bind(&WaitForFence, GetDisplay(), fence); | 128 base::Bind(&WaitForFence, GetDisplay(), fence); |
| 129 | 129 |
| 130 base::Closure fence_retired_callback = | 130 base::Closure fence_retired_callback = |
| 131 base::Bind(&GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), | 131 base::Bind(&GbmSurfaceless::FenceRetired, weak_factory_.GetWeakPtr(), |
| 132 fence, frame); | 132 fence, frame); |
| 133 | 133 |
| 134 base::PostTaskWithTraitsAndReply( | 134 base::WorkerPool::PostTaskAndReply(FROM_HERE, fence_wait_task, |
| 135 FROM_HERE, base::TaskTraits() | 135 fence_retired_callback, false); |
| 136 .WithShutdownBehavior( | |
| 137 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | |
| 138 .MayBlock(), | |
| 139 fence_wait_task, fence_retired_callback); | |
| 140 return; // Defer frame submission until fence signals. | 136 return; // Defer frame submission until fence signals. |
| 141 } | 137 } |
| 142 | 138 |
| 143 frame->ready = true; | 139 frame->ready = true; |
| 144 SubmitFrame(); | 140 SubmitFrame(); |
| 145 } | 141 } |
| 146 | 142 |
| 147 void GbmSurfaceless::PostSubBufferAsync( | 143 void GbmSurfaceless::PostSubBufferAsync( |
| 148 int x, | 144 int x, |
| 149 int y, | 145 int y, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 241 } |
| 246 | 242 |
| 247 SubmitFrame(); | 243 SubmitFrame(); |
| 248 } | 244 } |
| 249 | 245 |
| 250 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() { | 246 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() { |
| 251 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish(); | 247 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish(); |
| 252 } | 248 } |
| 253 | 249 |
| 254 } // namespace ui | 250 } // namespace ui |
| OLD | NEW |