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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_window.cc

Issue 1780013002: Fix black screen when switching primary display without bounds change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build failure in MockScanoutBuffer (again! sorry) Created 4 years, 7 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 | « ui/ozone/platform/drm/gpu/drm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.h » ('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_window.h" 5 #include "ui/ozone/platform/drm/gpu/drm_window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 void DrmWindow::MoveCursor(const gfx::Point& location) { 117 void DrmWindow::MoveCursor(const gfx::Point& location) {
118 cursor_location_ = location; 118 cursor_location_ = location;
119 119
120 if (controller_) 120 if (controller_)
121 controller_->MoveCursor(location); 121 controller_->MoveCursor(location);
122 } 122 }
123 123
124 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, 124 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes,
125 const SwapCompletionCallback& callback) { 125 const SwapCompletionCallback& callback) {
126 if (controller_) {
127 const DrmDevice* drm = controller_->GetAllocationDrmDevice().get();
128 for (const auto& plane : planes) {
129 if (plane.buffer && plane.buffer->GetDrmDevice() != drm) {
130 // Although |force_buffer_reallocation_| is set to true during window
131 // bounds update, this may still be needed because of in-flight buffers.
132 force_buffer_reallocation_ = true;
133 break;
134 }
135 }
136 }
137
126 if (force_buffer_reallocation_) { 138 if (force_buffer_reallocation_) {
127 force_buffer_reallocation_ = false; 139 force_buffer_reallocation_ = false;
128 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); 140 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS);
129 return; 141 return;
130 } 142 }
131 143
132 last_submitted_planes_ = 144 last_submitted_planes_ =
133 overlay_validator_->PrepareBuffersForPageFlip(planes); 145 overlay_validator_->PrepareBuffersForPageFlip(planes);
134 146
135 if (!controller_) { 147 if (!controller_) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!cursor_buffers_[i]->Initialize( 251 if (!cursor_buffers_[i]->Initialize(
240 info, false /* should_register_framebuffer */)) { 252 info, false /* should_register_framebuffer */)) {
241 LOG(FATAL) << "Failed to initialize cursor buffer"; 253 LOG(FATAL) << "Failed to initialize cursor buffer";
242 return; 254 return;
243 } 255 }
244 } 256 }
245 } 257 }
246 } 258 }
247 259
248 } // namespace ui 260 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698