Chromium Code Reviews| 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) { | |
|
dnicoara
2016/05/06 19:17:21
If I understood this correctly this is only requir
hshi
2016/05/06 19:22:31
Done.
| |
| 130 force_buffer_reallocation_ = true; | |
| 131 break; | |
| 132 } | |
| 133 } | |
| 134 } | |
| 135 | |
| 126 if (force_buffer_reallocation_) { | 136 if (force_buffer_reallocation_) { |
| 127 force_buffer_reallocation_ = false; | 137 force_buffer_reallocation_ = false; |
| 128 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); | 138 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); |
| 129 return; | 139 return; |
| 130 } | 140 } |
| 131 | 141 |
| 132 last_submitted_planes_ = | 142 last_submitted_planes_ = |
| 133 overlay_validator_->PrepareBuffersForPageFlip(planes); | 143 overlay_validator_->PrepareBuffersForPageFlip(planes); |
| 134 | 144 |
| 135 if (!controller_) { | 145 if (!controller_) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 if (!cursor_buffers_[i]->Initialize( | 249 if (!cursor_buffers_[i]->Initialize( |
| 240 info, false /* should_register_framebuffer */)) { | 250 info, false /* should_register_framebuffer */)) { |
| 241 LOG(FATAL) << "Failed to initialize cursor buffer"; | 251 LOG(FATAL) << "Failed to initialize cursor buffer"; |
| 242 return; | 252 return; |
| 243 } | 253 } |
| 244 } | 254 } |
| 245 } | 255 } |
| 246 } | 256 } |
| 247 | 257 |
| 248 } // namespace ui | 258 } // namespace ui |
| OLD | NEW |