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 <drm_fourcc.h> | 5 #include <drm_fourcc.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void InitForTest(const FakePlaneInfo* planes, | 59 void InitForTest(const FakePlaneInfo* planes, |
60 size_t count, | 60 size_t count, |
61 const std::vector<uint32_t>& crtcs) { | 61 const std::vector<uint32_t>& crtcs) { |
62 crtcs_ = crtcs; | 62 crtcs_ = crtcs; |
63 for (size_t i = 0; i < count; i++) { | 63 for (size_t i = 0; i < count; i++) { |
64 scoped_ptr<ui::HardwareDisplayPlane> plane(new ui::HardwareDisplayPlane( | 64 scoped_ptr<ui::HardwareDisplayPlane> plane(new ui::HardwareDisplayPlane( |
65 planes[i].id, planes[i].allowed_crtc_mask)); | 65 planes[i].id, planes[i].allowed_crtc_mask)); |
66 // Add support to test more formats. | 66 // Add support to test more formats. |
67 plane->Initialize(drm_, std::vector<uint32_t>(1, DRM_FORMAT_XRGB8888), | 67 plane->Initialize(drm_, std::vector<uint32_t>(1, DRM_FORMAT_XRGB8888), |
68 false, true); | 68 false, true); |
69 planes_.push_back(plane.Pass()); | 69 planes_.push_back(std::move(plane)); |
70 } | 70 } |
71 // The real HDPM uses sorted planes, so sort them for consistency. | 71 // The real HDPM uses sorted planes, so sort them for consistency. |
72 std::sort(planes_.begin(), planes_.end(), | 72 std::sort(planes_.begin(), planes_.end(), |
73 [](const scoped_ptr<ui::HardwareDisplayPlane>& l, | 73 [](const scoped_ptr<ui::HardwareDisplayPlane>& l, |
74 const scoped_ptr<ui::HardwareDisplayPlane>& r) { | 74 const scoped_ptr<ui::HardwareDisplayPlane>& r) { |
75 return l->plane_id() < r->plane_id(); | 75 return l->plane_id() < r->plane_id(); |
76 }); | 76 }); |
77 } | 77 } |
78 | 78 |
79 bool Commit(ui::HardwareDisplayPlaneList* plane_list, | 79 bool Commit(ui::HardwareDisplayPlaneList* plane_list, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 assigns.push_back(ui::OverlayPlane(primary_buffer)); | 292 assigns.push_back(ui::OverlayPlane(primary_buffer)); |
293 drm->plane_manager()->BeginFrame(&hdpl); | 293 drm->plane_manager()->BeginFrame(&hdpl); |
294 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, | 294 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, |
295 crtcs[0], &crtc)); | 295 crtcs[0], &crtc)); |
296 EXPECT_EQ(0, drm->get_overlay_clear_call_count()); | 296 EXPECT_EQ(0, drm->get_overlay_clear_call_count()); |
297 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl, false)); | 297 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl, false)); |
298 EXPECT_EQ(1, drm->get_overlay_clear_call_count()); | 298 EXPECT_EQ(1, drm->get_overlay_clear_call_count()); |
299 } | 299 } |
300 | 300 |
301 } // namespace | 301 } // namespace |
OLD | NEW |