@@ -619,14 +619,32 @@ TEST_F(LayerLifecycleManagerTest, isSimpleBufferUpdate) {
619619 }
620620}
621621
622- TEST_F (LayerLifecycleManagerTest, testInputInfoOfRequestedLayerState) {
623- // By default the layer has no buffer, so it doesn't need an input info
624- EXPECT_FALSE (getRequestedLayerState (mLifecycleManager , 111 )->needsInputInfo ());
622+ TEST_F (LayerLifecycleManagerTest, layerWithBufferNeedsInputInfo) {
623+ // If a layer has no buffer or no color, it doesn't have an input info
624+ LayerHierarchyTestBase::createRootLayer (3 );
625+ setColor (3 , {-1 ._hf , -1 ._hf , -1 ._hf });
626+ mLifecycleManager .commitChanges ();
627+
628+ EXPECT_FALSE (getRequestedLayerState (mLifecycleManager , 3 )->needsInputInfo ());
629+
630+ setBuffer (3 );
631+ mLifecycleManager .commitChanges ();
632+
633+ EXPECT_TRUE (getRequestedLayerState (mLifecycleManager , 3 )->needsInputInfo ());
634+ }
635+
636+ TEST_F (LayerLifecycleManagerTest, layerWithColorNeedsInputInfo) {
637+ // If a layer has no buffer or no color, it doesn't have an input info
638+ LayerHierarchyTestBase::createRootLayer (4 );
639+ setColor (4 , {-1 ._hf , -1 ._hf , -1 ._hf });
640+ mLifecycleManager .commitChanges ();
641+
642+ EXPECT_FALSE (getRequestedLayerState (mLifecycleManager , 4 )->needsInputInfo ());
625643
626- setBuffer ( 111 );
644+ setColor ( 4 , { 1 . _hf , 0 . _hf , 0 . _hf } );
627645 mLifecycleManager .commitChanges ();
628646
629- EXPECT_TRUE (getRequestedLayerState (mLifecycleManager , 111 )->needsInputInfo ());
647+ EXPECT_TRUE (getRequestedLayerState (mLifecycleManager , 4 )->needsInputInfo ());
630648}
631649
632650} // namespace android::surfaceflinger::frontend
0 commit comments