| 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/dri/test/mock_dri_wrapper.h" | 5 #include "ui/ozone/platform/dri/test/mock_dri_wrapper.h" |
| 6 | 6 |
| 7 #include <xf86drm.h> | 7 #include <xf86drm.h> |
| 8 #include <xf86drmMode.h> | 8 #include <xf86drmMode.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 remove_framebuffer_call_count_++; | 126 remove_framebuffer_call_count_++; |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 ScopedDrmFramebufferPtr MockDriWrapper::GetFramebuffer(uint32_t framebuffer) { | 130 ScopedDrmFramebufferPtr MockDriWrapper::GetFramebuffer(uint32_t framebuffer) { |
| 131 return ScopedDrmFramebufferPtr(); | 131 return ScopedDrmFramebufferPtr(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool MockDriWrapper::PageFlip(uint32_t crtc_id, | 134 bool MockDriWrapper::PageFlip(uint32_t crtc_id, |
| 135 uint32_t framebuffer, | 135 uint32_t framebuffer, |
| 136 bool is_sync, |
| 136 const PageFlipCallback& callback) { | 137 const PageFlipCallback& callback) { |
| 137 page_flip_call_count_++; | 138 page_flip_call_count_++; |
| 138 current_framebuffer_ = framebuffer; | 139 current_framebuffer_ = framebuffer; |
| 139 if (page_flip_expectation_) { | 140 if (page_flip_expectation_) { |
| 140 if (use_sync_flips_) | 141 if (use_sync_flips_) |
| 141 callback.Run(0, 0, 0); | 142 callback.Run(0, 0, 0); |
| 142 else | 143 else |
| 143 callbacks_.push(callback); | 144 callbacks_.push(callback); |
| 144 } | 145 } |
| 145 | 146 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 215 |
| 215 void MockDriWrapper::RunCallbacks() { | 216 void MockDriWrapper::RunCallbacks() { |
| 216 while (!callbacks_.empty()) { | 217 while (!callbacks_.empty()) { |
| 217 PageFlipCallback callback = callbacks_.front(); | 218 PageFlipCallback callback = callbacks_.front(); |
| 218 callbacks_.pop(); | 219 callbacks_.pop(); |
| 219 callback.Run(0, 0, 0); | 220 callback.Run(0, 0, 0); |
| 220 } | 221 } |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace ui | 224 } // namespace ui |
| OLD | NEW |