| 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 "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| 6 | 6 |
| 7 #include "ui/ozone/platform/drm/gpu/drm_thread.h" | 7 #include "ui/ozone/platform/drm/gpu/drm_thread.h" |
| 8 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" | 8 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" |
| 9 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" | 9 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| 10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 10 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 DrmWindowProxy::DrmWindowProxy(gfx::AcceleratedWidget widget, | 14 DrmWindowProxy::DrmWindowProxy(gfx::AcceleratedWidget widget, |
| 15 DrmThread* drm_thread) | 15 DrmThread* drm_thread) |
| 16 : widget_(widget), drm_thread_(drm_thread) {} | 16 : widget_(widget), drm_thread_(drm_thread) {} |
| 17 | 17 |
| 18 DrmWindowProxy::~DrmWindowProxy() {} | 18 DrmWindowProxy::~DrmWindowProxy() {} |
| 19 | 19 |
| 20 void DrmWindowProxy::SchedulePageFlip(const std::vector<OverlayPlane>& planes, | 20 void DrmWindowProxy::SchedulePageFlip(const std::vector<OverlayPlane>& planes, |
| 21 const SwapCompletionCallback& callback) { | 21 SwapCompletionOnceCallback callback) { |
| 22 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); |
| 22 drm_thread_->task_runner()->PostTask( | 23 drm_thread_->task_runner()->PostTask( |
| 23 FROM_HERE, | 24 FROM_HERE, base::BindOnce(&DrmThread::SchedulePageFlip, |
| 24 base::Bind(&DrmThread::SchedulePageFlip, base::Unretained(drm_thread_), | 25 base::Unretained(drm_thread_), widget_, planes, |
| 25 widget_, planes, CreateSafeCallback(callback))); | 26 std::move(safe_callback))); |
| 26 } | 27 } |
| 27 | 28 |
| 28 void DrmWindowProxy::GetVSyncParameters( | 29 void DrmWindowProxy::GetVSyncParameters( |
| 29 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { | 30 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { |
| 30 drm_thread_->task_runner()->PostTask( | 31 drm_thread_->task_runner()->PostTask( |
| 31 FROM_HERE, | 32 FROM_HERE, |
| 32 base::Bind(&DrmThread::GetVSyncParameters, base::Unretained(drm_thread_), | 33 base::Bind(&DrmThread::GetVSyncParameters, base::Unretained(drm_thread_), |
| 33 widget_, CreateSafeCallback(callback))); | 34 widget_, CreateSafeCallback(callback))); |
| 34 } | 35 } |
| 35 | 36 |
| 36 } // namespace ui | 37 } // namespace ui |
| OLD | NEW |