| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 std::vector<uint32_t> crtcs, | 62 std::vector<uint32_t> crtcs, |
| 63 size_t planes_per_crtc) | 63 size_t planes_per_crtc) |
| 64 : DriWrapper("", use_sync_flips), | 64 : DriWrapper("", use_sync_flips), |
| 65 get_crtc_call_count_(0), | 65 get_crtc_call_count_(0), |
| 66 set_crtc_call_count_(0), | 66 set_crtc_call_count_(0), |
| 67 restore_crtc_call_count_(0), | 67 restore_crtc_call_count_(0), |
| 68 add_framebuffer_call_count_(0), | 68 add_framebuffer_call_count_(0), |
| 69 remove_framebuffer_call_count_(0), | 69 remove_framebuffer_call_count_(0), |
| 70 page_flip_call_count_(0), | 70 page_flip_call_count_(0), |
| 71 overlay_flip_call_count_(0), | 71 overlay_flip_call_count_(0), |
| 72 overlay_clear_call_count_(0), |
| 72 set_crtc_expectation_(true), | 73 set_crtc_expectation_(true), |
| 73 add_framebuffer_expectation_(true), | 74 add_framebuffer_expectation_(true), |
| 74 page_flip_expectation_(true), | 75 page_flip_expectation_(true), |
| 75 create_dumb_buffer_expectation_(true), | 76 create_dumb_buffer_expectation_(true), |
| 76 current_framebuffer_(0) { | 77 current_framebuffer_(0) { |
| 77 fd_ = fd; | 78 fd_ = fd; |
| 78 plane_manager_.reset( | 79 plane_manager_.reset( |
| 79 new MockHardwareDisplayPlaneManager(this, crtcs, planes_per_crtc)); | 80 new MockHardwareDisplayPlaneManager(this, crtcs, planes_per_crtc)); |
| 80 } | 81 } |
| 81 | 82 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 147 } |
| 147 | 148 |
| 148 return page_flip_expectation_; | 149 return page_flip_expectation_; |
| 149 } | 150 } |
| 150 | 151 |
| 151 bool MockDriWrapper::PageFlipOverlay(uint32_t crtc_id, | 152 bool MockDriWrapper::PageFlipOverlay(uint32_t crtc_id, |
| 152 uint32_t framebuffer, | 153 uint32_t framebuffer, |
| 153 const gfx::Rect& location, | 154 const gfx::Rect& location, |
| 154 const gfx::Rect& source, | 155 const gfx::Rect& source, |
| 155 int overlay_plane) { | 156 int overlay_plane) { |
| 157 if (!framebuffer) |
| 158 overlay_clear_call_count_++; |
| 156 overlay_flip_call_count_++; | 159 overlay_flip_call_count_++; |
| 157 return true; | 160 return true; |
| 158 } | 161 } |
| 159 | 162 |
| 160 ScopedDrmPropertyPtr MockDriWrapper::GetProperty(drmModeConnector* connector, | 163 ScopedDrmPropertyPtr MockDriWrapper::GetProperty(drmModeConnector* connector, |
| 161 const char* name) { | 164 const char* name) { |
| 162 return ScopedDrmPropertyPtr(DrmAllocator<drmModePropertyRes>()); | 165 return ScopedDrmPropertyPtr(DrmAllocator<drmModePropertyRes>()); |
| 163 } | 166 } |
| 164 | 167 |
| 165 bool MockDriWrapper::SetProperty(uint32_t connector_id, | 168 bool MockDriWrapper::SetProperty(uint32_t connector_id, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 217 |
| 215 void MockDriWrapper::RunCallbacks() { | 218 void MockDriWrapper::RunCallbacks() { |
| 216 while (!callbacks_.empty()) { | 219 while (!callbacks_.empty()) { |
| 217 PageFlipCallback callback = callbacks_.front(); | 220 PageFlipCallback callback = callbacks_.front(); |
| 218 callbacks_.pop(); | 221 callbacks_.pop(); |
| 219 callback.Run(0, 0, 0); | 222 callback.Run(0, 0, 0); |
| 220 } | 223 } |
| 221 } | 224 } |
| 222 | 225 |
| 223 } // namespace ui | 226 } // namespace ui |
| OLD | NEW |