| 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/mock_drm_device.h" | 5 #include "ui/ozone/platform/drm/gpu/mock_drm_device.h" |
| 6 | 6 |
| 7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
| 8 #include <xf86drm.h> | 8 #include <xf86drm.h> |
| 9 #include <xf86drmMode.h> | 9 #include <xf86drmMode.h> |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 bool MockDrmDevice::DisableCrtc(uint32_t crtc_id) { | 113 bool MockDrmDevice::DisableCrtc(uint32_t crtc_id) { |
| 114 current_framebuffer_ = 0; | 114 current_framebuffer_ = 0; |
| 115 return true; | 115 return true; |
| 116 } | 116 } |
| 117 | 117 |
| 118 ScopedDrmConnectorPtr MockDrmDevice::GetConnector(uint32_t connector_id) { | 118 ScopedDrmConnectorPtr MockDrmDevice::GetConnector(uint32_t connector_id) { |
| 119 return ScopedDrmConnectorPtr(DrmAllocator<drmModeConnector>()); | 119 return ScopedDrmConnectorPtr(DrmAllocator<drmModeConnector>()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool MockDrmDevice::AddFramebuffer(uint32_t width, | 122 bool MockDrmDevice::AddFramebuffer2(uint32_t width, |
| 123 uint32_t height, | 123 uint32_t height, |
| 124 uint8_t depth, | 124 uint32_t format, |
| 125 uint8_t bpp, | 125 uint32_t handles[4], |
| 126 uint32_t stride, | 126 uint32_t strides[4], |
| 127 uint32_t handle, | 127 uint32_t offsets[4], |
| 128 uint32_t* framebuffer) { | 128 uint32_t* framebuffer, |
| 129 uint32_t flags) { |
| 129 add_framebuffer_call_count_++; | 130 add_framebuffer_call_count_++; |
| 130 *framebuffer = add_framebuffer_call_count_; | 131 *framebuffer = add_framebuffer_call_count_; |
| 131 return add_framebuffer_expectation_; | 132 return add_framebuffer_expectation_; |
| 132 } | 133 } |
| 133 | 134 |
| 134 bool MockDrmDevice::RemoveFramebuffer(uint32_t framebuffer) { | 135 bool MockDrmDevice::RemoveFramebuffer(uint32_t framebuffer) { |
| 135 remove_framebuffer_call_count_++; | 136 remove_framebuffer_call_count_++; |
| 136 return true; | 137 return true; |
| 137 } | 138 } |
| 138 | 139 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 257 |
| 257 void MockDrmDevice::RunCallbacks() { | 258 void MockDrmDevice::RunCallbacks() { |
| 258 while (!callbacks_.empty()) { | 259 while (!callbacks_.empty()) { |
| 259 PageFlipCallback callback = callbacks_.front(); | 260 PageFlipCallback callback = callbacks_.front(); |
| 260 callbacks_.pop(); | 261 callbacks_.pop(); |
| 261 callback.Run(0, 0, 0); | 262 callback.Run(0, 0, 0); |
| 262 } | 263 } |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace ui | 266 } // namespace ui |
| OLD | NEW |