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