summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wenhui Yang <wenhuiy@google.com> 2024-12-16 07:46:55 +0000
committer Wenhui Yang <wenhuiy@google.com> 2025-01-22 14:36:46 -0800
commit3bcb0a8f776347cfa6b1c364971374becdae9a64 (patch)
tree7d396b9eab5dee0ca55a4379d7ce1db52cf20615
parent9cab74cf510538ae8ecd9bfed7c269c502708a4a (diff)
Revert the change of unifying visibility
Fixes: 305254099 Flag: com.android.graphics.surfaceflinger.flags.skip_invisible_windows_in_input Test: libgui_test.InputSurfacesTest Change-Id: Ibadb7f9c60438474c3f7c15a17ee3ad0d8c61ac0
-rw-r--r--services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
index 7289e2f201..91192473c7 100644
--- a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
@@ -264,28 +264,21 @@ void updateVisibility(LayerSnapshot& snapshot, bool visible) {
}
snapshot.isVisible = visible;
- if (FlagManager::getInstance().skip_invisible_windows_in_input()) {
- const bool visibleForInput =
- snapshot.isVisible || (snapshot.hasInputInfo() && !snapshot.isHiddenByPolicy());
- snapshot.inputInfo.setInputConfig(gui::WindowInfo::InputConfig::NOT_VISIBLE,
- !visibleForInput);
- } else {
- // TODO(b/238781169) we are ignoring this compat for now, since we will have
- // to remove any optimization based on visibility.
-
- // For compatibility reasons we let layers which can receive input
- // receive input before they have actually submitted a buffer. Because
- // of this we use canReceiveInput instead of isVisible to check the
- // policy-visibility, ignoring the buffer state. However for layers with
- // hasInputInfo()==false we can use the real visibility state.
- // We are just using these layers for occlusion detection in
- // InputDispatcher, and obviously if they aren't visible they can't occlude
- // anything.
- const bool visibleForInput =
- snapshot.hasInputInfo() ? snapshot.canReceiveInput() : snapshot.isVisible;
- snapshot.inputInfo.setInputConfig(gui::WindowInfo::InputConfig::NOT_VISIBLE,
- !visibleForInput);
- }
+ // TODO(b/238781169) we are ignoring this compat for now, since we will have
+ // to remove any optimization based on visibility.
+
+ // For compatibility reasons we let layers which can receive input
+ // receive input before they have actually submitted a buffer. Because
+ // of this we use canReceiveInput instead of isVisible to check the
+ // policy-visibility, ignoring the buffer state. However for layers with
+ // hasInputInfo()==false we can use the real visibility state.
+ // We are just using these layers for occlusion detection in
+ // InputDispatcher, and obviously if they aren't visible they can't occlude
+ // anything.
+ const bool visibleForInput =
+ snapshot.hasInputInfo() ? snapshot.canReceiveInput() : snapshot.isVisible;
+ snapshot.inputInfo.setInputConfig(gui::WindowInfo::InputConfig::NOT_VISIBLE, !visibleForInput);
+
LLOGV(snapshot.sequence, "updating visibility %s %s", visible ? "true" : "false",
snapshot.getDebugString().c_str());
}