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

Unified Diff: ui/ozone/platform/drm/gpu/hardware_display_controller.cc

Issue 2886503002: Convert additional ozone/drm callbacks to OnceCallback (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/gpu/hardware_display_controller.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index 7b577900378e1ac475166ed24f48517355e58848..ca8f8d1b7a3dd40fa80f3bf34e6956c68b61f8a7 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -77,32 +77,33 @@ void HardwareDisplayController::Disable() {
void HardwareDisplayController::SchedulePageFlip(
const OverlayPlaneList& plane_list,
- const PageFlipCallback& callback) {
- ActualSchedulePageFlip(plane_list, false /* test_only */, callback);
+ SwapCompletionOnceCallback callback) {
+ ActualSchedulePageFlip(plane_list, false /* test_only */,
+ std::move(callback));
}
bool HardwareDisplayController::TestPageFlip(
const OverlayPlaneList& plane_list) {
return ActualSchedulePageFlip(plane_list, true /* test_only */,
- base::Bind(&EmptyFlipCallback));
+ base::BindOnce(&EmptyFlipCallback));
}
bool HardwareDisplayController::ActualSchedulePageFlip(
const OverlayPlaneList& plane_list,
bool test_only,
- const PageFlipCallback& callback) {
+ SwapCompletionOnceCallback callback) {
TRACE_EVENT0("drm", "HDC::SchedulePageFlip");
DCHECK(!is_disabled_);
// Ignore requests with no planes to schedule.
if (plane_list.empty()) {
- callback.Run(gfx::SwapResult::SWAP_ACK);
+ std::move(callback).Run(gfx::SwapResult::SWAP_ACK);
return true;
}
scoped_refptr<PageFlipRequest> page_flip_request =
- new PageFlipRequest(crtc_controllers_.size(), callback);
+ new PageFlipRequest(crtc_controllers_.size(), std::move(callback));
OverlayPlaneList pending_planes = plane_list;
std::sort(pending_planes.begin(), pending_planes.end(),
@@ -110,7 +111,7 @@ bool HardwareDisplayController::ActualSchedulePageFlip(
return l.z_order < r.z_order;
});
if (pending_planes.front().z_order != 0) {
- callback.Run(gfx::SwapResult::SWAP_FAILED);
+ std::move(callback).Run(gfx::SwapResult::SWAP_FAILED);
return false;
}

Powered by Google App Engine
This is Rietveld 408576698