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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/gpu/drm_surface.h" 5 #include "ui/ozone/platform/drm/gpu/drm_surface.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 canvas->drawImageRect(pending_image_.get(), real_damage, real_damage, NULL); 92 canvas->drawImageRect(pending_image_.get(), real_damage, real_damage, NULL);
93 last_damage_ = pending_image_damage_; 93 last_damage_ = pending_image_damage_;
94 94
95 pending_image_ = nullptr; 95 pending_image_ = nullptr;
96 pending_image_damage_ = gfx::Rect(); 96 pending_image_damage_ = gfx::Rect();
97 97
98 window_->QueueOverlayPlane(OverlayPlane(back_buffer_)); 98 window_->QueueOverlayPlane(OverlayPlane(back_buffer_));
99 99
100 // Update our front buffer pointer. 100 // Update our front buffer pointer.
101 std::swap(front_buffer_, back_buffer_); 101 std::swap(front_buffer_, back_buffer_);
102 pending_pageflip_ = window_->SchedulePageFlip( 102 pending_pageflip_ = true;
alexst (slow to review) 2015/09/08 21:12:53 Please make a quick note that this is a re-entranc
dnicoara 2015/09/09 14:09:52 Done.
103 false /* is_sync */, 103 if (!window_->SchedulePageFlip(false /* is_sync */,
104 base::Bind(&DrmSurface::OnPageFlip, weak_ptr_factory_.GetWeakPtr())); 104 base::Bind(&DrmSurface::OnPageFlip,
105 weak_ptr_factory_.GetWeakPtr()))) {
106 pending_pageflip_ = false;
107 }
105 } 108 }
106 109
107 void DrmSurface::OnPageFlip(gfx::SwapResult result) { 110 void DrmSurface::OnPageFlip(gfx::SwapResult result) {
108 pending_pageflip_ = false; 111 pending_pageflip_ = false;
109 if (!pending_image_) 112 if (!pending_image_)
110 return; 113 return;
111 114
112 SchedulePageFlip(); 115 SchedulePageFlip();
113 } 116 }
114 117
115 } // namespace ui 118 } // namespace ui
OLDNEW
« 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