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

Unified Diff: ui/ozone/platform/drm/gpu/hardware_display_controller.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 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..46218658981d6b3e597cb936460e8db47695530e 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -77,42 +77,42 @@ 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);
-
OverlayPlaneList pending_planes = plane_list;
std::sort(pending_planes.begin(), pending_planes.end(),
[](const OverlayPlane& l, const OverlayPlane& r) {
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;
}
+ scoped_refptr<PageFlipRequest> page_flip_request =
+ new PageFlipRequest(crtc_controllers_.size(), std::move(callback));
for (const auto& planes : owned_hardware_planes_)
planes.first->plane_manager()->BeginFrame(planes.second.get());
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_controller.h ('k') | ui/ozone/platform/drm/gpu/page_flip_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698