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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 void DrmWindow::MoveCursor(const gfx::Point& location) { | 122 void DrmWindow::MoveCursor(const gfx::Point& location) { |
123 cursor_location_ = location; | 123 cursor_location_ = location; |
124 | 124 |
125 if (controller_) | 125 if (controller_) |
126 controller_->MoveCursor(location); | 126 controller_->MoveCursor(location); |
127 } | 127 } |
128 | 128 |
129 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, | 129 void DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, |
130 const SwapCompletionCallback& callback) { | 130 const SwapCompletionCallback& callback, |
| 131 ScanoutBufferGenerator* buffer_generator) { |
131 if (force_buffer_reallocation_) { | 132 if (force_buffer_reallocation_) { |
132 force_buffer_reallocation_ = false; | 133 force_buffer_reallocation_ = false; |
133 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); | 134 callback.Run(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS); |
134 return; | 135 return; |
135 } | 136 } |
136 | 137 |
137 last_submitted_planes_ = planes; | 138 last_submitted_planes_ = |
| 139 overlay_validator_->ValidatePlanesForPageFlip(planes, buffer_generator); |
138 | 140 |
139 if (!controller_) { | 141 if (!controller_) { |
140 callback.Run(gfx::SwapResult::SWAP_ACK); | 142 callback.Run(gfx::SwapResult::SWAP_ACK); |
141 return; | 143 return; |
142 } | 144 } |
143 | 145 |
144 controller_->SchedulePageFlip(last_submitted_planes_, callback); | 146 controller_->SchedulePageFlip(last_submitted_planes_, callback); |
145 } | 147 } |
146 | 148 |
147 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip( | 149 std::vector<OverlayCheck_Params> DrmWindow::TestPageFlip( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (!cursor_buffers_[i]->Initialize( | 249 if (!cursor_buffers_[i]->Initialize( |
248 info, false /* should_register_framebuffer */)) { | 250 info, false /* should_register_framebuffer */)) { |
249 LOG(FATAL) << "Failed to initialize cursor buffer"; | 251 LOG(FATAL) << "Failed to initialize cursor buffer"; |
250 return; | 252 return; |
251 } | 253 } |
252 } | 254 } |
253 } | 255 } |
254 } | 256 } |
255 | 257 |
256 } // namespace ui | 258 } // namespace ui |
OLD | NEW |