| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |