Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_window_proxy.cc

Issue 2886503002: Convert additional ozone/drm callbacks to OnceCallback (Closed)
Patch Set: fixed nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_proxy.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698