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 "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 set_crtc_call_count_++; | 54 set_crtc_call_count_++; |
55 return set_crtc_expectation_; | 55 return set_crtc_expectation_; |
56 } | 56 } |
57 | 57 |
58 bool MockDriWrapper::SetCrtc(drmModeCrtc* crtc, | 58 bool MockDriWrapper::SetCrtc(drmModeCrtc* crtc, |
59 std::vector<uint32_t> connectors) { | 59 std::vector<uint32_t> connectors) { |
60 restore_crtc_call_count_++; | 60 restore_crtc_call_count_++; |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
| 64 ScopedDrmConnectorPtr MockDriWrapper::GetConnector(uint32_t connector_id) { |
| 65 return ScopedDrmConnectorPtr(DrmAllocator<drmModeConnector>()); |
| 66 } |
| 67 |
64 bool MockDriWrapper::AddFramebuffer(uint32_t width, | 68 bool MockDriWrapper::AddFramebuffer(uint32_t width, |
65 uint32_t height, | 69 uint32_t height, |
66 uint8_t depth, | 70 uint8_t depth, |
67 uint8_t bpp, | 71 uint8_t bpp, |
68 uint32_t stride, | 72 uint32_t stride, |
69 uint32_t handle, | 73 uint32_t handle, |
70 uint32_t* framebuffer) { | 74 uint32_t* framebuffer) { |
71 add_framebuffer_call_count_++; | 75 add_framebuffer_call_count_++; |
72 *framebuffer = add_framebuffer_call_count_; | 76 *framebuffer = add_framebuffer_call_count_; |
73 return add_framebuffer_expectation_; | 77 return add_framebuffer_expectation_; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 151 } |
148 | 152 |
149 void MockDriWrapper::DestroyDumbBuffer(const SkImageInfo& info, | 153 void MockDriWrapper::DestroyDumbBuffer(const SkImageInfo& info, |
150 uint32_t handle, | 154 uint32_t handle, |
151 uint32_t stride, | 155 uint32_t stride, |
152 void* pixels) { | 156 void* pixels) { |
153 delete[] static_cast<char*>(pixels); | 157 delete[] static_cast<char*>(pixels); |
154 } | 158 } |
155 | 159 |
156 } // namespace ui | 160 } // namespace ui |
OLD | NEW |