| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 set_crtc_call_count_++; | 98 set_crtc_call_count_++; |
| 99 return set_crtc_expectation_; | 99 return set_crtc_expectation_; |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool MockDriWrapper::SetCrtc(drmModeCrtc* crtc, | 102 bool MockDriWrapper::SetCrtc(drmModeCrtc* crtc, |
| 103 std::vector<uint32_t> connectors) { | 103 std::vector<uint32_t> connectors) { |
| 104 restore_crtc_call_count_++; | 104 restore_crtc_call_count_++; |
| 105 return true; | 105 return true; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool MockDriWrapper::DisableCrtc(uint32_t crtc_id) { |
| 109 current_framebuffer_ = 0; |
| 110 return true; |
| 111 } |
| 112 |
| 108 ScopedDrmConnectorPtr MockDriWrapper::GetConnector(uint32_t connector_id) { | 113 ScopedDrmConnectorPtr MockDriWrapper::GetConnector(uint32_t connector_id) { |
| 109 return ScopedDrmConnectorPtr(DrmAllocator<drmModeConnector>()); | 114 return ScopedDrmConnectorPtr(DrmAllocator<drmModeConnector>()); |
| 110 } | 115 } |
| 111 | 116 |
| 112 bool MockDriWrapper::AddFramebuffer(uint32_t width, | 117 bool MockDriWrapper::AddFramebuffer(uint32_t width, |
| 113 uint32_t height, | 118 uint32_t height, |
| 114 uint8_t depth, | 119 uint8_t depth, |
| 115 uint8_t bpp, | 120 uint8_t bpp, |
| 116 uint32_t stride, | 121 uint32_t stride, |
| 117 uint32_t handle, | 122 uint32_t handle, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 209 } |
| 205 | 210 |
| 206 void MockDriWrapper::DestroyDumbBuffer(const SkImageInfo& info, | 211 void MockDriWrapper::DestroyDumbBuffer(const SkImageInfo& info, |
| 207 uint32_t handle, | 212 uint32_t handle, |
| 208 uint32_t stride, | 213 uint32_t stride, |
| 209 void* pixels) { | 214 void* pixels) { |
| 210 delete[] static_cast<char*>(pixels); | 215 delete[] static_cast<char*>(pixels); |
| 211 } | 216 } |
| 212 | 217 |
| 213 } // namespace ui | 218 } // namespace ui |
| OLD | NEW |