Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/drm_overlay_validator.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_overlay_validator.h" |
| 6 | 6 |
| 7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 621 plane_list.back().buffer->GetFramebufferPixelFormat()); | 621 plane_list.back().buffer->GetFramebufferPixelFormat()); |
| 622 plane_list_.back().processing_callback = base::Bind( | 622 plane_list_.back().processing_callback = base::Bind( |
| 623 &DrmOverlayValidatorTest::ReturnNullBuffer, base::Unretained(this)); | 623 &DrmOverlayValidatorTest::ReturnNullBuffer, base::Unretained(this)); |
| 624 | 624 |
| 625 plane_list = overlay_validator_->PrepareBuffersForPageFlip(plane_list_); | 625 plane_list = overlay_validator_->PrepareBuffersForPageFlip(plane_list_); |
| 626 EXPECT_EQ(plane_list_.back().buffer->GetFramebufferPixelFormat(), | 626 EXPECT_EQ(plane_list_.back().buffer->GetFramebufferPixelFormat(), |
| 627 plane_list.back().buffer->GetFramebufferPixelFormat()); | 627 plane_list.back().buffer->GetFramebufferPixelFormat()); |
| 628 plane_list_.back().processing_callback = base::Bind( | 628 plane_list_.back().processing_callback = base::Bind( |
| 629 &DrmOverlayValidatorTest::ProcessBuffer, base::Unretained(this)); | 629 &DrmOverlayValidatorTest::ProcessBuffer, base::Unretained(this)); |
| 630 } | 630 } |
| 631 | |
| 632 TEST_F(DrmOverlayValidatorTest, RejectBufferAllocationFail) { | |
| 633 // If a buffer is too big, buffer allocation for scanout will fail. | |
|
dnicoara
2017/02/21 19:03:18
Since we're expecting the AddFramebuffer2() call t
Daniele Castagna
2017/02/21 19:12:21
You're right that what you described is the scenar
dnicoara
2017/02/21 19:19:39
Oh, you're right, that makes me feel a bit sad :(
| |
| 634 // In that case we should reject the overlay candidate. | |
| 635 ui::OverlayCheck_Params too_big_candidate; | |
| 636 | |
| 637 too_big_candidate.buffer_size = gfx::Size(4800, 3200); | |
| 638 too_big_candidate.display_rect = primary_rect_; | |
| 639 std::vector<ui::OverlayCheck_Params> overlay_params; | |
| 640 overlay_params.push_back(too_big_candidate); | |
| 641 | |
| 642 std::vector<ui::OverlayCheck_Params> validated_params = | |
| 643 overlay_validator_->TestPageFlip(overlay_params, ui::OverlayPlaneList()); | |
| 644 EXPECT_FALSE(validated_params.front().is_overlay_candidate); | |
| 645 } | |
| OLD | NEW |