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

Unified Diff: ui/ozone/platform/dri/hardware_display_controller.cc

Issue 960273003: ozone: dri: add synchronous SwapBuffers support on surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/dri/hardware_display_controller.cc
diff --git a/ui/ozone/platform/dri/hardware_display_controller.cc b/ui/ozone/platform/dri/hardware_display_controller.cc
index 0bd49477e857fcabbd05c7c4a4ec1a41bf88c5dc..5e8bcbf608bfedfaeeff93b5c527dd7176cfa98a 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -105,7 +105,28 @@ bool HardwareDisplayController::SchedulePageFlip(
if (HasPendingPageFlips())
return true;
- bool status = ActualSchedulePageFlip();
+ bool status = ActualSchedulePageFlip(false);
+
+ // No page flip event on failure so discard failed request.
+ if (!status)
+ requests_.pop_front();
+
+ return status;
+}
+
+bool HardwareDisplayController::PageFlip() {
dnicoara 2015/02/26 18:22:21 I think you can just use SchedulePageFlip() for th
+ CHECK(!HasPendingPageFlips());
+ TRACE_EVENT0("dri", "HDC::PageFlip");
+
+ // Ignore requests with no planes to schedule.
+ if (pending_planes_.empty())
+ return true;
+
+ requests_.push_back(
+ PageFlipRequest(pending_planes_, base::Bind(&base::DoNothing)));
+ pending_planes_.clear();
+
+ bool status = ActualSchedulePageFlip(true);
// No page flip event on failure so discard failed request.
if (!status)
@@ -246,7 +267,7 @@ void HardwareDisplayController::OnPageFlipEvent() {
return;
// At this point we still have requests pending, so schedule the next request.
- bool status = ActualSchedulePageFlip();
+ bool status = ActualSchedulePageFlip(false);
if (!status) {
PageFlipRequest request = requests_.front();
requests_.pop_front();
@@ -274,7 +295,7 @@ bool HardwareDisplayController::HasPendingPageFlips() const {
return false;
}
-bool HardwareDisplayController::ActualSchedulePageFlip() {
+bool HardwareDisplayController::ActualSchedulePageFlip(bool is_sync) {
TRACE_EVENT0("dri", "HDC::ActualSchedulePageFlip");
DCHECK(!requests_.empty());
@@ -297,7 +318,7 @@ bool HardwareDisplayController::ActualSchedulePageFlip() {
}
for (const auto& planes : owned_hardware_planes_) {
- if (!planes.first->plane_manager()->Commit(planes.second)) {
+ if (!planes.first->plane_manager()->Commit(planes.second, is_sync)) {
status = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698