| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 controller_->SchedulePageFlip( | 197 controller_->SchedulePageFlip( |
| 198 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, | 198 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, |
| 199 base::Unretained(this))); | 199 base::Unretained(this))); |
| 200 drm_->RunCallbacks(); | 200 drm_->RunCallbacks(); |
| 201 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); | 201 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); |
| 202 EXPECT_EQ(2, page_flips_); | 202 EXPECT_EQ(2, page_flips_); |
| 203 EXPECT_EQ(2, drm_->get_page_flip_call_count()); | 203 EXPECT_EQ(2, drm_->get_page_flip_call_count()); |
| 204 EXPECT_EQ(2, drm_->get_overlay_flip_call_count()); | 204 EXPECT_EQ(2, drm_->get_overlay_flip_call_count()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 TEST_F(HardwareDisplayControllerTest, CheckOverlayFullScreenMode) { | |
| 208 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( | |
| 209 new ui::MockScanoutBuffer(kDefaultModeSize))); | |
| 210 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>( | |
| 211 new ui::MockScanoutBuffer(kDefaultModeSize)), | |
| 212 1, gfx::OVERLAY_TRANSFORM_NONE, | |
| 213 gfx::Rect(kDefaultModeSize), | |
| 214 gfx::RectF(kDefaultModeSizeF)); | |
| 215 | |
| 216 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode)); | |
| 217 | |
| 218 std::vector<ui::OverlayPlane> planes; | |
| 219 planes.push_back(plane1); | |
| 220 planes.push_back(plane2); | |
| 221 | |
| 222 controller_->SchedulePageFlip( | |
| 223 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, | |
| 224 base::Unretained(this))); | |
| 225 drm_->RunCallbacks(); | |
| 226 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); | |
| 227 EXPECT_EQ(1, page_flips_); | |
| 228 EXPECT_EQ(1, drm_->get_page_flip_call_count()); | |
| 229 EXPECT_EQ(0, drm_->get_overlay_flip_call_count()); | |
| 230 } | |
| 231 | |
| 232 TEST_F(HardwareDisplayControllerTest, RejectUnderlays) { | 207 TEST_F(HardwareDisplayControllerTest, RejectUnderlays) { |
| 233 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( | 208 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( |
| 234 new ui::MockScanoutBuffer(kDefaultModeSize))); | 209 new ui::MockScanoutBuffer(kDefaultModeSize))); |
| 235 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>( | 210 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>( |
| 236 new ui::MockScanoutBuffer(kDefaultModeSize)), | 211 new ui::MockScanoutBuffer(kDefaultModeSize)), |
| 237 -1, gfx::OVERLAY_TRANSFORM_NONE, | 212 -1, gfx::OVERLAY_TRANSFORM_NONE, |
| 238 gfx::Rect(kDefaultModeSize), | 213 gfx::Rect(kDefaultModeSize), |
| 239 gfx::RectF(kDefaultModeSizeF)); | 214 gfx::RectF(kDefaultModeSizeF)); |
| 240 | 215 |
| 241 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode)); | 216 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode)); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, | 445 planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback, |
| 471 base::Unretained(this))); | 446 base::Unretained(this))); |
| 472 | 447 |
| 473 controller_->RemoveCrtc(drm_, kPrimaryCrtc); | 448 controller_->RemoveCrtc(drm_, kPrimaryCrtc); |
| 474 | 449 |
| 475 EXPECT_EQ(1, page_flips_); | 450 EXPECT_EQ(1, page_flips_); |
| 476 drm_->RunCallbacks(); | 451 drm_->RunCallbacks(); |
| 477 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); | 452 EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_); |
| 478 EXPECT_EQ(1, page_flips_); | 453 EXPECT_EQ(1, page_flips_); |
| 479 } | 454 } |
| OLD | NEW |