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

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: Schedule asynchronous flip correctly on flip callback 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..c14dfd29cc5fc8abe1d155c4f872392ba8ca15e1 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -24,8 +24,9 @@ namespace ui {
HardwareDisplayController::PageFlipRequest::PageFlipRequest(
const OverlayPlaneList& planes,
+ bool is_sync,
const base::Closure& callback)
- : planes(planes), callback(callback) {
+ : planes(planes), is_sync(is_sync), callback(callback) {
}
HardwareDisplayController::PageFlipRequest::~PageFlipRequest() {
@@ -63,7 +64,7 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
// callback. We use the modeset state since it is the only valid state.
if (HasPendingPageFlips())
requests_.push_back(
- PageFlipRequest(current_planes_, base::Bind(&base::DoNothing)));
+ PageFlipRequest(current_planes_, false, base::Bind(&base::DoNothing)));
return status;
}
@@ -89,6 +90,7 @@ void HardwareDisplayController::QueueOverlayPlane(const OverlayPlane& plane) {
}
bool HardwareDisplayController::SchedulePageFlip(
+ bool is_sync,
const base::Closure& callback) {
TRACE_EVENT0("dri", "HDC::SchedulePageFlip");
@@ -98,14 +100,14 @@ bool HardwareDisplayController::SchedulePageFlip(
return true;
}
- requests_.push_back(PageFlipRequest(pending_planes_, callback));
+ requests_.push_back(PageFlipRequest(pending_planes_, is_sync, callback));
pending_planes_.clear();
// A request is being serviced right now.
if (HasPendingPageFlips())
return true;
- bool status = ActualSchedulePageFlip();
+ bool status = ActualSchedulePageFlip(is_sync);
// No page flip event on failure so discard failed request.
if (!status)
@@ -245,10 +247,10 @@ void HardwareDisplayController::OnPageFlipEvent() {
if (requests_.empty())
return;
+ PageFlipRequest request = requests_.front();
dnicoara 2015/02/27 13:58:44 Move this back in the if-statement.
llandwerlin-old 2015/02/27 14:09:04 Done.
// At this point we still have requests pending, so schedule the next request.
- bool status = ActualSchedulePageFlip();
+ bool status = ActualSchedulePageFlip(request.is_sync);
if (!status) {
- PageFlipRequest request = requests_.front();
requests_.pop_front();
// Normally the caller would handle the error call, but because we're in a
@@ -274,7 +276,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 +299,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;
}
}
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_controller.h ('k') | ui/ozone/platform/dri/hardware_display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698