Loading libs/gui/SurfaceControl.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -139,9 +139,9 @@ sp<Surface> SurfaceControl::generateSurfaceLocked() uint32_t ignore; auto flags = mCreateFlags & (ISurfaceComposerClient::eCursorWindow | ISurfaceComposerClient::eOpaque); mBbqChild = mClient->createSurface(String8("bbq-wrapper"), 0, 0, mFormat, mBbqChild = mClient->createSurface(String8::format("[BBQ] %s", mName.c_str()), 0, 0, mFormat, flags, mHandle, {}, &ignore); mBbq = sp<BLASTBufferQueue>::make("bbq-adapter", mBbqChild, mWidth, mHeight, mFormat); mBbq = sp<BLASTBufferQueue>::make("[BBQ]" + mName, mBbqChild, mWidth, mHeight, mFormat); // This surface is always consumed by SurfaceFlinger, so the // producerControlledByApp value doesn't matter; using false. Loading services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -279,24 +279,6 @@ void updateVisibility(LayerSnapshot& snapshot, bool visible) { snapshot.getDebugString().c_str()); } bool needsInputInfo(const LayerSnapshot& snapshot, const RequestedLayerState& requested) { if (requested.potentialCursor) { return false; } if (snapshot.inputInfo.token != nullptr) { return true; } if (snapshot.hasBufferOrSidebandStream()) { return true; } return requested.windowInfoHandle && requested.windowInfoHandle->getInfo()->inputConfig.test( gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } void updateMetadata(LayerSnapshot& snapshot, const RequestedLayerState& requested, const LayerSnapshotBuilder::Args& args) { snapshot.metadata.clear(); Loading Loading @@ -1162,7 +1144,7 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot, } updateVisibility(snapshot, snapshot.isVisible); if (!needsInputInfo(snapshot, requested)) { if (!requested.needsInputInfo()) { return; } Loading @@ -1172,7 +1154,7 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot, bool noValidDisplay = !displayInfoOpt.has_value(); auto displayInfo = displayInfoOpt.value_or(sDefaultInfo); if (!requested.windowInfoHandle) { if (!requested.hasInputInfo()) { snapshot.inputInfo.inputConfig = InputConfig::NO_INPUT_CHANNEL; } fillInputFrameInfo(snapshot.inputInfo, displayInfo.transform, snapshot); Loading services/surfaceflinger/FrontEnd/RequestedLayerState.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ RequestedLayerState::RequestedLayerState(const LayerCreationArgs& args) metadata.merge(args.metadata); changes |= RequestedLayerState::Changes::Metadata; handleAlive = true; // TODO: b/305254099 remove once we don't pass invisible windows to input windowInfoHandle = nullptr; if (parentId != UNASSIGNED_LAYER_ID) { canBeRoot = false; } Loading Loading @@ -553,6 +555,24 @@ bool RequestedLayerState::hasInputInfo() const { windowInfo->inputConfig.test(gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } bool RequestedLayerState::needsInputInfo() const { if (potentialCursor) { return false; } if ((sidebandStream != nullptr) || (externalTexture != nullptr)) { return true; } if (!windowInfoHandle) { return false; } const auto windowInfo = windowInfoHandle->getInfo(); return windowInfo->token != nullptr || windowInfo->inputConfig.test(gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } bool RequestedLayerState::hasBlur() const { return backgroundBlurRadius > 0 || blurRegions.size() > 0; } Loading services/surfaceflinger/FrontEnd/RequestedLayerState.h +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ struct RequestedLayerState : layer_state_t { aidl::android::hardware::graphics::composer3::Composition getCompositionType() const; bool hasValidRelativeParent() const; bool hasInputInfo() const; bool needsInputInfo() const; bool hasBlur() const; bool hasFrameUpdate() const; bool hasReadyFrame() const; Loading services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -619,4 +619,14 @@ TEST_F(LayerLifecycleManagerTest, isSimpleBufferUpdate) { } } TEST_F(LayerLifecycleManagerTest, testInputInfoOfRequestedLayerState) { // By default the layer has no buffer, so it doesn't need an input info EXPECT_FALSE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo()); setBuffer(111); mLifecycleManager.commitChanges(); EXPECT_TRUE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo()); } } // namespace android::surfaceflinger::frontend Loading
libs/gui/SurfaceControl.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -139,9 +139,9 @@ sp<Surface> SurfaceControl::generateSurfaceLocked() uint32_t ignore; auto flags = mCreateFlags & (ISurfaceComposerClient::eCursorWindow | ISurfaceComposerClient::eOpaque); mBbqChild = mClient->createSurface(String8("bbq-wrapper"), 0, 0, mFormat, mBbqChild = mClient->createSurface(String8::format("[BBQ] %s", mName.c_str()), 0, 0, mFormat, flags, mHandle, {}, &ignore); mBbq = sp<BLASTBufferQueue>::make("bbq-adapter", mBbqChild, mWidth, mHeight, mFormat); mBbq = sp<BLASTBufferQueue>::make("[BBQ]" + mName, mBbqChild, mWidth, mHeight, mFormat); // This surface is always consumed by SurfaceFlinger, so the // producerControlledByApp value doesn't matter; using false. Loading
services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -279,24 +279,6 @@ void updateVisibility(LayerSnapshot& snapshot, bool visible) { snapshot.getDebugString().c_str()); } bool needsInputInfo(const LayerSnapshot& snapshot, const RequestedLayerState& requested) { if (requested.potentialCursor) { return false; } if (snapshot.inputInfo.token != nullptr) { return true; } if (snapshot.hasBufferOrSidebandStream()) { return true; } return requested.windowInfoHandle && requested.windowInfoHandle->getInfo()->inputConfig.test( gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } void updateMetadata(LayerSnapshot& snapshot, const RequestedLayerState& requested, const LayerSnapshotBuilder::Args& args) { snapshot.metadata.clear(); Loading Loading @@ -1162,7 +1144,7 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot, } updateVisibility(snapshot, snapshot.isVisible); if (!needsInputInfo(snapshot, requested)) { if (!requested.needsInputInfo()) { return; } Loading @@ -1172,7 +1154,7 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot, bool noValidDisplay = !displayInfoOpt.has_value(); auto displayInfo = displayInfoOpt.value_or(sDefaultInfo); if (!requested.windowInfoHandle) { if (!requested.hasInputInfo()) { snapshot.inputInfo.inputConfig = InputConfig::NO_INPUT_CHANNEL; } fillInputFrameInfo(snapshot.inputInfo, displayInfo.transform, snapshot); Loading
services/surfaceflinger/FrontEnd/RequestedLayerState.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ RequestedLayerState::RequestedLayerState(const LayerCreationArgs& args) metadata.merge(args.metadata); changes |= RequestedLayerState::Changes::Metadata; handleAlive = true; // TODO: b/305254099 remove once we don't pass invisible windows to input windowInfoHandle = nullptr; if (parentId != UNASSIGNED_LAYER_ID) { canBeRoot = false; } Loading Loading @@ -553,6 +555,24 @@ bool RequestedLayerState::hasInputInfo() const { windowInfo->inputConfig.test(gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } bool RequestedLayerState::needsInputInfo() const { if (potentialCursor) { return false; } if ((sidebandStream != nullptr) || (externalTexture != nullptr)) { return true; } if (!windowInfoHandle) { return false; } const auto windowInfo = windowInfoHandle->getInfo(); return windowInfo->token != nullptr || windowInfo->inputConfig.test(gui::WindowInfo::InputConfig::NO_INPUT_CHANNEL); } bool RequestedLayerState::hasBlur() const { return backgroundBlurRadius > 0 || blurRegions.size() > 0; } Loading
services/surfaceflinger/FrontEnd/RequestedLayerState.h +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ struct RequestedLayerState : layer_state_t { aidl::android::hardware::graphics::composer3::Composition getCompositionType() const; bool hasValidRelativeParent() const; bool hasInputInfo() const; bool needsInputInfo() const; bool hasBlur() const; bool hasFrameUpdate() const; bool hasReadyFrame() const; Loading
services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -619,4 +619,14 @@ TEST_F(LayerLifecycleManagerTest, isSimpleBufferUpdate) { } } TEST_F(LayerLifecycleManagerTest, testInputInfoOfRequestedLayerState) { // By default the layer has no buffer, so it doesn't need an input info EXPECT_FALSE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo()); setBuffer(111); mLifecycleManager.commitChanges(); EXPECT_TRUE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo()); } } // namespace android::surfaceflinger::frontend