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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 cursor_location_ = location; | 114 cursor_location_ = location; |
115 | 115 |
116 if (controller_) | 116 if (controller_) |
117 controller_->MoveCursor(location); | 117 controller_->MoveCursor(location); |
118 } | 118 } |
119 | 119 |
120 void DrmWindow::QueueOverlayPlane(const OverlayPlane& plane) { | 120 void DrmWindow::QueueOverlayPlane(const OverlayPlane& plane) { |
121 pending_planes_.push_back(plane); | 121 pending_planes_.push_back(plane); |
122 } | 122 } |
123 | 123 |
124 bool DrmWindow::SchedulePageFlip(bool is_sync, const base::Closure& callback) { | 124 bool DrmWindow::SchedulePageFlip( |
125 bool is_sync, | |
126 const base::Callback<void(gfx::SwapResult)>& callback) { | |
alexst (slow to review)
2015/04/29 17:53:37
We should typdef this as well somewhere in the pla
achaulk
2015/05/06 18:29:48
Done.
| |
125 last_submitted_planes_.clear(); | 127 last_submitted_planes_.clear(); |
126 last_submitted_planes_.swap(pending_planes_); | 128 last_submitted_planes_.swap(pending_planes_); |
127 last_swap_sync_ = is_sync; | 129 last_swap_sync_ = is_sync; |
128 | 130 |
129 if (controller_) { | 131 if (controller_) { |
130 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, | 132 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, |
131 callback); | 133 callback); |
132 } | 134 } |
133 | 135 |
134 callback.Run(); | 136 callback.Run(gfx::SwapAck); |
135 return true; | 137 return true; |
136 } | 138 } |
137 | 139 |
138 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { | 140 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { |
139 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); | 141 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); |
140 } | 142 } |
141 | 143 |
142 void DrmWindow::ResetCursor(bool bitmap_only) { | 144 void DrmWindow::ResetCursor(bool bitmap_only) { |
143 if (!controller_) | 145 if (!controller_) |
144 return; | 146 return; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 if (!cursor_buffers_[i]->Initialize( | 203 if (!cursor_buffers_[i]->Initialize( |
202 info, false /* should_register_framebuffer */)) { | 204 info, false /* should_register_framebuffer */)) { |
203 LOG(FATAL) << "Failed to initialize cursor buffer"; | 205 LOG(FATAL) << "Failed to initialize cursor buffer"; |
204 return; | 206 return; |
205 } | 207 } |
206 } | 208 } |
207 } | 209 } |
208 } | 210 } |
209 | 211 |
210 } // namespace ui | 212 } // namespace ui |
OLD | NEW |