Loading libs/ui/include/ui/LayerStack.h +5 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ namespace android::ui { // A LayerStack identifies a Z-ordered group of layers. A layer can only be associated to a single // LayerStack, but a LayerStack can be associated to multiple displays, mirroring the same content. // LayerStack, and a LayerStack should be unique to each display in the composition target. struct LayerStack { uint32_t id = UINT32_MAX; Loading @@ -40,7 +40,9 @@ struct LayerStack { } }; constexpr LayerStack INVALID_LAYER_STACK; // An unassigned LayerStack can indicate that a layer is offscreen and will not be // rendered onto a display. Multiple displays are allowed to have unassigned LayerStacks. constexpr LayerStack UNASSIGNED_LAYER_STACK; constexpr LayerStack DEFAULT_LAYER_STACK{0u}; inline bool operator==(LayerStack lhs, LayerStack rhs) { Loading Loading @@ -70,7 +72,7 @@ struct LayerFilter { // Returns true if the input filter can be output to this filter. bool includes(LayerFilter other) const { // The layer stacks must match. if (other.layerStack == INVALID_LAYER_STACK || other.layerStack != layerStack) { if (other.layerStack == UNASSIGNED_LAYER_STACK || other.layerStack != layerStack) { return false; } Loading services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ TEST_F(DisplaySetConfigurationTest, configuresPhysicalDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading @@ -322,7 +322,7 @@ TEST_F(DisplaySetConfigurationTest, configuresHalVirtualDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading @@ -342,7 +342,7 @@ TEST_F(DisplaySetConfigurationTest, configuresGpuVirtualDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -646,8 +646,8 @@ TEST_F(OutputTest, layerFiltering) { mOutput->setLayerFilter({layerStack1, true}); // It excludes layers with no layer stack, internal-only or not. EXPECT_FALSE(mOutput->includesLayer({ui::INVALID_LAYER_STACK, false})); EXPECT_FALSE(mOutput->includesLayer({ui::INVALID_LAYER_STACK, true})); EXPECT_FALSE(mOutput->includesLayer({ui::UNASSIGNED_LAYER_STACK, false})); EXPECT_FALSE(mOutput->includesLayer({ui::UNASSIGNED_LAYER_STACK, true})); // It includes layers on layerStack1, internal-only or not. EXPECT_TRUE(mOutput->includesLayer({layerStack1, false})); Loading Loading @@ -685,10 +685,10 @@ TEST_F(OutputTest, layerFilteringWithCompositionState) { mOutput->setLayerFilter({layerStack1, true}); // It excludes layers with no layer stack, internal-only or not. layer.layerFEState.outputFilter = {ui::INVALID_LAYER_STACK, false}; layer.layerFEState.outputFilter = {ui::UNASSIGNED_LAYER_STACK, false}; EXPECT_FALSE(mOutput->includesLayer(layerFE)); layer.layerFEState.outputFilter = {ui::INVALID_LAYER_STACK, true}; layer.layerFEState.outputFilter = {ui::UNASSIGNED_LAYER_STACK, true}; EXPECT_FALSE(mOutput->includesLayer(layerFE)); // It includes layers on layerStack1, internal-only or not. Loading services/surfaceflinger/FrontEnd/LayerCreationArgs.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ std::string LayerCreationArgs::getDebugString() const { if (layerIdToMirror != UNASSIGNED_LAYER_ID) { stream << " layerIdToMirror=" << layerIdToMirror; } if (layerStackToMirror != ui::INVALID_LAYER_STACK) { if (layerStackToMirror != ui::UNASSIGNED_LAYER_STACK) { stream << " layerStackToMirror=" << layerStackToMirror.id; } return stream.str(); Loading services/surfaceflinger/FrontEnd/LayerCreationArgs.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ struct LayerCreationArgs { bool addToRoot = true; wp<IBinder> parentHandle = nullptr; wp<IBinder> mirrorLayerHandle = nullptr; ui::LayerStack layerStackToMirror = ui::INVALID_LAYER_STACK; ui::LayerStack layerStackToMirror = ui::UNASSIGNED_LAYER_STACK; uint32_t parentId = UNASSIGNED_LAYER_ID; uint32_t layerIdToMirror = UNASSIGNED_LAYER_ID; std::atomic<int32_t>* pendingBuffers = 0; Loading Loading
libs/ui/include/ui/LayerStack.h +5 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ namespace android::ui { // A LayerStack identifies a Z-ordered group of layers. A layer can only be associated to a single // LayerStack, but a LayerStack can be associated to multiple displays, mirroring the same content. // LayerStack, and a LayerStack should be unique to each display in the composition target. struct LayerStack { uint32_t id = UINT32_MAX; Loading @@ -40,7 +40,9 @@ struct LayerStack { } }; constexpr LayerStack INVALID_LAYER_STACK; // An unassigned LayerStack can indicate that a layer is offscreen and will not be // rendered onto a display. Multiple displays are allowed to have unassigned LayerStacks. constexpr LayerStack UNASSIGNED_LAYER_STACK; constexpr LayerStack DEFAULT_LAYER_STACK{0u}; inline bool operator==(LayerStack lhs, LayerStack rhs) { Loading Loading @@ -70,7 +72,7 @@ struct LayerFilter { // Returns true if the input filter can be output to this filter. bool includes(LayerFilter other) const { // The layer stacks must match. if (other.layerStack == INVALID_LAYER_STACK || other.layerStack != layerStack) { if (other.layerStack == UNASSIGNED_LAYER_STACK || other.layerStack != layerStack) { return false; } Loading
services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ TEST_F(DisplaySetConfigurationTest, configuresPhysicalDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading @@ -322,7 +322,7 @@ TEST_F(DisplaySetConfigurationTest, configuresHalVirtualDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading @@ -342,7 +342,7 @@ TEST_F(DisplaySetConfigurationTest, configuresGpuVirtualDisplay) { EXPECT_FALSE(mDisplay->isValid()); const auto& filter = mDisplay->getState().layerFilter; EXPECT_EQ(ui::INVALID_LAYER_STACK, filter.layerStack); EXPECT_EQ(ui::UNASSIGNED_LAYER_STACK, filter.layerStack); EXPECT_FALSE(filter.toInternalDisplay); } Loading
services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -646,8 +646,8 @@ TEST_F(OutputTest, layerFiltering) { mOutput->setLayerFilter({layerStack1, true}); // It excludes layers with no layer stack, internal-only or not. EXPECT_FALSE(mOutput->includesLayer({ui::INVALID_LAYER_STACK, false})); EXPECT_FALSE(mOutput->includesLayer({ui::INVALID_LAYER_STACK, true})); EXPECT_FALSE(mOutput->includesLayer({ui::UNASSIGNED_LAYER_STACK, false})); EXPECT_FALSE(mOutput->includesLayer({ui::UNASSIGNED_LAYER_STACK, true})); // It includes layers on layerStack1, internal-only or not. EXPECT_TRUE(mOutput->includesLayer({layerStack1, false})); Loading Loading @@ -685,10 +685,10 @@ TEST_F(OutputTest, layerFilteringWithCompositionState) { mOutput->setLayerFilter({layerStack1, true}); // It excludes layers with no layer stack, internal-only or not. layer.layerFEState.outputFilter = {ui::INVALID_LAYER_STACK, false}; layer.layerFEState.outputFilter = {ui::UNASSIGNED_LAYER_STACK, false}; EXPECT_FALSE(mOutput->includesLayer(layerFE)); layer.layerFEState.outputFilter = {ui::INVALID_LAYER_STACK, true}; layer.layerFEState.outputFilter = {ui::UNASSIGNED_LAYER_STACK, true}; EXPECT_FALSE(mOutput->includesLayer(layerFE)); // It includes layers on layerStack1, internal-only or not. Loading
services/surfaceflinger/FrontEnd/LayerCreationArgs.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ std::string LayerCreationArgs::getDebugString() const { if (layerIdToMirror != UNASSIGNED_LAYER_ID) { stream << " layerIdToMirror=" << layerIdToMirror; } if (layerStackToMirror != ui::INVALID_LAYER_STACK) { if (layerStackToMirror != ui::UNASSIGNED_LAYER_STACK) { stream << " layerStackToMirror=" << layerStackToMirror.id; } return stream.str(); Loading
services/surfaceflinger/FrontEnd/LayerCreationArgs.h +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ struct LayerCreationArgs { bool addToRoot = true; wp<IBinder> parentHandle = nullptr; wp<IBinder> mirrorLayerHandle = nullptr; ui::LayerStack layerStackToMirror = ui::INVALID_LAYER_STACK; ui::LayerStack layerStackToMirror = ui::UNASSIGNED_LAYER_STACK; uint32_t parentId = UNASSIGNED_LAYER_ID; uint32_t layerIdToMirror = UNASSIGNED_LAYER_ID; std::atomic<int32_t>* pendingBuffers = 0; Loading