summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp
diff options
context:
space:
mode:
authorAdy Abraham <adyabr@google.com>2020-07-31 16:01:53 -0700
committerAdy Abraham <adyabr@google.com>2021-01-27 23:01:07 +0000
commitf467f898f42eccda1207a90d54e0b7d18b762a1b (patch)
tree098c819e371b3c5b0c54693f7a1c7d2cb7b62ba8 /services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp
parent814bc2250c245ddc03f505e8d0424aae66b3567f (diff)
SF: use parent layer frame rate
If an ancestor of a layer set a frame rate, and that layer doesn't have a frame rate configured, use the one of the ancestor. The reason for this is to support the high refresh rate deny list where WM will set the frame rate on a container layer which is not visible. With this change we will treat all child layers of that container as if they voted themselves. Test: test app that sets preferredDisplayModeId Bug: 163079696 Change-Id: I3c55d393af72e19cd7b4f107d8cc0b2e85289d96 Merged-In: I3c55d393af72e19cd7b4f107d8cc0b2e85289d96 (cherry picked from commit 20dcde8e35b003a82e4c14d39c76f93a16ec6e9d)
Diffstat (limited to 'services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp')
-rw-r--r--services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp b/services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp
index 1bbe8e2485..c8f4cb4c19 100644
--- a/services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp
+++ b/services/surfaceflinger/tests/unittests/SetFrameRateTest.cpp
@@ -263,13 +263,13 @@ TEST_P(SetFrameRateTest, SetAndGetParentAllVote) {
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE3, parent->getFrameRateForLayerTree());
EXPECT_EQ(FRAME_RATE_VOTE2, child1->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child2->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE2, child2->getFrameRateForLayerTree());
child1->setFrameRate(FRAME_RATE_NO_VOTE);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE3, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child2->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE3, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE3, child2->getFrameRateForLayerTree());
parent->setFrameRate(FRAME_RATE_NO_VOTE);
commitTransaction();
@@ -293,8 +293,8 @@ TEST_P(SetFrameRateTest, SetAndGetChild) {
parent->setFrameRate(FRAME_RATE_VOTE1);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE1, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child2->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child2->getFrameRateForLayerTree());
parent->setFrameRate(FRAME_RATE_NO_VOTE);
commitTransaction();
@@ -356,14 +356,14 @@ TEST_P(SetFrameRateTest, SetAndGetChildAddAfterVote) {
parent->setFrameRate(FRAME_RATE_VOTE1);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE1, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child1->getFrameRateForLayerTree());
EXPECT_EQ(FRAME_RATE_NO_VOTE, child2->getFrameRateForLayerTree());
addChild(child1, child2);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE1, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child2->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child2->getFrameRateForLayerTree());
parent->setFrameRate(FRAME_RATE_NO_VOTE);
commitTransaction();
@@ -387,13 +387,13 @@ TEST_P(SetFrameRateTest, SetAndGetChildRemoveAfterVote) {
parent->setFrameRate(FRAME_RATE_VOTE1);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE1, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child2->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child2->getFrameRateForLayerTree());
removeChild(child1, child2);
commitTransaction();
EXPECT_EQ(FRAME_RATE_VOTE1, parent->getFrameRateForLayerTree());
- EXPECT_EQ(FRAME_RATE_TREE, child1->getFrameRateForLayerTree());
+ EXPECT_EQ(FRAME_RATE_VOTE1, child1->getFrameRateForLayerTree());
EXPECT_EQ(FRAME_RATE_NO_VOTE, child2->getFrameRateForLayerTree());
parent->setFrameRate(FRAME_RATE_NO_VOTE);