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 19 matching lines...) Expand all Loading... |
30 const int kPlaneBaseId = 50; | 30 const int kPlaneBaseId = 50; |
31 drm_ = drm; | 31 drm_ = drm; |
32 crtcs_.swap(crtcs); | 32 crtcs_.swap(crtcs); |
33 for (size_t crtc_idx = 0; crtc_idx < crtcs_.size(); crtc_idx++) { | 33 for (size_t crtc_idx = 0; crtc_idx < crtcs_.size(); crtc_idx++) { |
34 for (size_t i = 0; i < planes_per_crtc; i++) { | 34 for (size_t i = 0; i < planes_per_crtc; i++) { |
35 scoped_ptr<HardwareDisplayPlane> plane( | 35 scoped_ptr<HardwareDisplayPlane> plane( |
36 new HardwareDisplayPlane(kPlaneBaseId + i, 1 << crtc_idx)); | 36 new HardwareDisplayPlane(kPlaneBaseId + i, 1 << crtc_idx)); |
37 // Add support to test more formats. | 37 // Add support to test more formats. |
38 plane->Initialize(drm, std::vector<uint32_t>(1, DRM_FORMAT_XRGB8888), | 38 plane->Initialize(drm, std::vector<uint32_t>(1, DRM_FORMAT_XRGB8888), |
39 false, true); | 39 false, true); |
40 planes_.push_back(plane.Pass()); | 40 planes_.push_back(std::move(plane)); |
41 } | 41 } |
42 } | 42 } |
43 } | 43 } |
44 }; | 44 }; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 MockDrmDevice::MockDrmDevice() | 48 MockDrmDevice::MockDrmDevice() |
49 : DrmDevice(base::FilePath(), base::File(), true /* is_primary_device */), | 49 : DrmDevice(base::FilePath(), base::File(), true /* is_primary_device */), |
50 get_crtc_call_count_(0), | 50 get_crtc_call_count_(0), |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 void MockDrmDevice::RunCallbacks() { | 258 void MockDrmDevice::RunCallbacks() { |
259 while (!callbacks_.empty()) { | 259 while (!callbacks_.empty()) { |
260 PageFlipCallback callback = callbacks_.front(); | 260 PageFlipCallback callback = callbacks_.front(); |
261 callbacks_.pop(); | 261 callbacks_.pop(); |
262 callback.Run(0, 0, 0); | 262 callback.Run(0, 0, 0); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 } // namespace ui | 266 } // namespace ui |
OLD | NEW |