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 "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
10 #include "third_party/skia/include/core/SkSurface.h" | 10 #include "third_party/skia/include/core/SkSurface.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 cursor_location_ = location; | 117 cursor_location_ = location; |
118 | 118 |
119 if (controller_) | 119 if (controller_) |
120 controller_->MoveCursor(location); | 120 controller_->MoveCursor(location); |
121 } | 121 } |
122 | 122 |
123 void DrmWindow::QueueOverlayPlane(const OverlayPlane& plane) { | 123 void DrmWindow::QueueOverlayPlane(const OverlayPlane& plane) { |
124 pending_planes_.push_back(plane); | 124 pending_planes_.push_back(plane); |
125 } | 125 } |
126 | 126 |
127 bool DrmWindow::SchedulePageFlip(bool is_sync, const base::Closure& callback) { | 127 bool DrmWindow::SchedulePageFlip(bool is_sync, |
| 128 const SwapCompletionCallback& callback) { |
128 last_submitted_planes_.clear(); | 129 last_submitted_planes_.clear(); |
129 last_submitted_planes_.swap(pending_planes_); | 130 last_submitted_planes_.swap(pending_planes_); |
130 last_swap_sync_ = is_sync; | 131 last_swap_sync_ = is_sync; |
131 | 132 |
132 if (controller_) { | 133 if (controller_) { |
133 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, false, | 134 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, false, |
134 callback); | 135 callback); |
135 } | 136 } |
136 | 137 |
137 callback.Run(); | 138 callback.Run(gfx::SwapResult::SWAP_ACK); |
138 return true; | 139 return true; |
139 } | 140 } |
140 | 141 |
141 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { | 142 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { |
142 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); | 143 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); |
143 } | 144 } |
144 | 145 |
145 void DrmWindow::ResetCursor(bool bitmap_only) { | 146 void DrmWindow::ResetCursor(bool bitmap_only) { |
146 if (!controller_) | 147 if (!controller_) |
147 return; | 148 return; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (!cursor_buffers_[i]->Initialize( | 205 if (!cursor_buffers_[i]->Initialize( |
205 info, false /* should_register_framebuffer */)) { | 206 info, false /* should_register_framebuffer */)) { |
206 LOG(FATAL) << "Failed to initialize cursor buffer"; | 207 LOG(FATAL) << "Failed to initialize cursor buffer"; |
207 return; | 208 return; |
208 } | 209 } |
209 } | 210 } |
210 } | 211 } |
211 } | 212 } |
212 | 213 |
213 } // namespace ui | 214 } // namespace ui |
OLD | NEW |