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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/ozone/platform/dri/crtc_controller.h" | 9 #include "ui/ozone/platform/dri/crtc_controller.h" |
10 #include "ui/ozone/platform/dri/hardware_display_controller.h" | 10 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 planes_.push_back(new ui::HardwareDisplayPlane( | 54 planes_.push_back(new ui::HardwareDisplayPlane( |
55 planes[i].id, planes[i].allowed_crtc_mask)); | 55 planes[i].id, planes[i].allowed_crtc_mask)); |
56 } | 56 } |
57 // The real HDPM uses sorted planes, so sort them for consistency. | 57 // The real HDPM uses sorted planes, so sort them for consistency. |
58 std::sort(planes_.begin(), planes_.end(), | 58 std::sort(planes_.begin(), planes_.end(), |
59 [](ui::HardwareDisplayPlane* l, ui::HardwareDisplayPlane* r) { | 59 [](ui::HardwareDisplayPlane* l, ui::HardwareDisplayPlane* r) { |
60 return l->plane_id() < r->plane_id(); | 60 return l->plane_id() < r->plane_id(); |
61 }); | 61 }); |
62 } | 62 } |
63 | 63 |
64 bool Commit(ui::HardwareDisplayPlaneList* plane_list) override { | 64 bool Commit(ui::HardwareDisplayPlaneList* plane_list, bool is_sync) override { |
65 return false; | 65 return false; |
66 } | 66 } |
67 | 67 |
68 bool SetPlaneData(ui::HardwareDisplayPlaneList* plane_list, | 68 bool SetPlaneData(ui::HardwareDisplayPlaneList* plane_list, |
69 ui::HardwareDisplayPlane* hw_plane, | 69 ui::HardwareDisplayPlane* hw_plane, |
70 const ui::OverlayPlane& overlay, | 70 const ui::OverlayPlane& overlay, |
71 uint32_t crtc_id, | 71 uint32_t crtc_id, |
72 const gfx::Rect& src_rect, | 72 const gfx::Rect& src_rect, |
73 ui::CrtcController* crtc) override { | 73 ui::CrtcController* crtc) override { |
74 // Check that the chosen plane is a legal choice for the crtc. | 74 // Check that the chosen plane is a legal choice for the crtc. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 scoped_refptr<ui::MockDriWrapper> drm = | 235 scoped_refptr<ui::MockDriWrapper> drm = |
236 new ui::MockDriWrapper(false, crtcs, 2); | 236 new ui::MockDriWrapper(false, crtcs, 2); |
237 ui::OverlayPlaneList assigns; | 237 ui::OverlayPlaneList assigns; |
238 scoped_refptr<FakeScanoutBuffer> fake_buffer = new FakeScanoutBuffer(); | 238 scoped_refptr<FakeScanoutBuffer> fake_buffer = new FakeScanoutBuffer(); |
239 assigns.push_back(ui::OverlayPlane(fake_buffer)); | 239 assigns.push_back(ui::OverlayPlane(fake_buffer)); |
240 assigns.push_back(ui::OverlayPlane(fake_buffer)); | 240 assigns.push_back(ui::OverlayPlane(fake_buffer)); |
241 ui::HardwareDisplayPlaneList hdpl; | 241 ui::HardwareDisplayPlaneList hdpl; |
242 ui::CrtcController crtc(drm, crtcs[0], 0); | 242 ui::CrtcController crtc(drm, crtcs[0], 0); |
243 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, | 243 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, |
244 crtcs[0], &crtc)); | 244 crtcs[0], &crtc)); |
245 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl)); | 245 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl, false)); |
246 assigns.clear(); | 246 assigns.clear(); |
247 assigns.push_back(ui::OverlayPlane(fake_buffer)); | 247 assigns.push_back(ui::OverlayPlane(fake_buffer)); |
248 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, | 248 EXPECT_TRUE(drm->plane_manager()->AssignOverlayPlanes(&hdpl, assigns, |
249 crtcs[0], &crtc)); | 249 crtcs[0], &crtc)); |
250 EXPECT_EQ(0, drm->get_overlay_clear_call_count()); | 250 EXPECT_EQ(0, drm->get_overlay_clear_call_count()); |
251 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl)); | 251 EXPECT_TRUE(drm->plane_manager()->Commit(&hdpl, false)); |
252 EXPECT_EQ(1, drm->get_overlay_clear_call_count()); | 252 EXPECT_EQ(1, drm->get_overlay_clear_call_count()); |
253 } | 253 } |
254 | 254 |
255 } // namespace | 255 } // namespace |
OLD | NEW |