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

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

Issue 1334483002: Force buffer re-allocation when the backing display changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 5 years, 3 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
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_surface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/drm_surface.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_surface.cc b/ui/ozone/platform/drm/gpu/drm_surface.cc
index f3780ff1ffe3a35cca39e33f0004d6a11f04aae9..8d58d5978ca784baa2a42f75fe3884b229d75c0c 100644
--- a/ui/ozone/platform/drm/gpu/drm_surface.cc
+++ b/ui/ozone/platform/drm/gpu/drm_surface.cc
@@ -99,9 +99,14 @@ void DrmSurface::SchedulePageFlip() {
// Update our front buffer pointer.
std::swap(front_buffer_, back_buffer_);
- pending_pageflip_ = window_->SchedulePageFlip(
- false /* is_sync */,
- base::Bind(&DrmSurface::OnPageFlip, weak_ptr_factory_.GetWeakPtr()));
+ // First set the pending flag otherwise there could be a re-entrancy issue if
+ // the callback is executed synchronously.
+ pending_pageflip_ = true;
+ if (!window_->SchedulePageFlip(false /* is_sync */,
+ base::Bind(&DrmSurface::OnPageFlip,
+ weak_ptr_factory_.GetWeakPtr()))) {
+ pending_pageflip_ = false;
+ }
}
void DrmSurface::OnPageFlip(gfx::SwapResult result) {
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698