| 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, | 127 bool DrmWindow::SchedulePageFlip(bool is_sync, const base::Closure& callback) { |
| 128 const SwapCompletionCallback& callback) { | |
| 129 last_submitted_planes_.clear(); | 128 last_submitted_planes_.clear(); |
| 130 last_submitted_planes_.swap(pending_planes_); | 129 last_submitted_planes_.swap(pending_planes_); |
| 131 last_swap_sync_ = is_sync; | 130 last_swap_sync_ = is_sync; |
| 132 | 131 |
| 133 if (controller_) { | 132 if (controller_) { |
| 134 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, false, | 133 return controller_->SchedulePageFlip(last_submitted_planes_, is_sync, false, |
| 135 callback); | 134 callback); |
| 136 } | 135 } |
| 137 | 136 |
| 138 callback.Run(gfx::SwapResult::SWAP_ACK); | 137 callback.Run(); |
| 139 return true; | 138 return true; |
| 140 } | 139 } |
| 141 | 140 |
| 142 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { | 141 const OverlayPlane* DrmWindow::GetLastModesetBuffer() { |
| 143 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); | 142 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); |
| 144 } | 143 } |
| 145 | 144 |
| 146 void DrmWindow::ResetCursor(bool bitmap_only) { | 145 void DrmWindow::ResetCursor(bool bitmap_only) { |
| 147 if (!controller_) | 146 if (!controller_) |
| 148 return; | 147 return; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (!cursor_buffers_[i]->Initialize( | 204 if (!cursor_buffers_[i]->Initialize( |
| 206 info, false /* should_register_framebuffer */)) { | 205 info, false /* should_register_framebuffer */)) { |
| 207 LOG(FATAL) << "Failed to initialize cursor buffer"; | 206 LOG(FATAL) << "Failed to initialize cursor buffer"; |
| 208 return; | 207 return; |
| 209 } | 208 } |
| 210 } | 209 } |
| 211 } | 210 } |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace ui | 213 } // namespace ui |
| OLD | NEW |