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

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

Issue 940903002: video_decode_accelerator_unittest: enable test on ozone surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remaining thumbnail issues 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..0b5ecaffbe3a812ac1993ab8d51149bafa725d21 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() {
+ 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 sync) {
TRACE_EVENT0("dri", "HDC::ActualSchedulePageFlip");
DCHECK(!requests_.empty());
@@ -297,8 +318,12 @@ bool HardwareDisplayController::ActualSchedulePageFlip() {
}
for (const auto& planes : owned_hardware_planes_) {
- if (!planes.first->plane_manager()->Commit(planes.second)) {
- status = false;
+ if (sync) {
+ if (!planes.first->plane_manager()->CommitSync(planes.second))
+ status = false;
+ } else {
+ if (!planes.first->plane_manager()->Commit(planes.second))
+ status = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698