summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/FrontEnd
AgeCommit message (Collapse)Author
2025-04-15Fix build break in 25Q2-release Vishnu Nair
Bug: 277076451 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5013ab8640c7cbd8fdf89f133b4fa9184576e26f) Merged-In: I5f9fb4e011abb383c51b0fc03553947f325c20ae Change-Id: I5f9fb4e011abb383c51b0fc03553947f325c20ae
2025-04-15Include color layers in input list to fix tapjacking vulnerability Wenhui Yang
We can use this to compute occlusion more accurately in inputdispatcher. Bug: 277076451 Test: app-debug.apk in the bug Test: go/wm-smoke Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1f0301b3f1061cb89d9628bbb1d2b4594f4f29dc) Merged-In: I1e155bcf4a6a7ff1b49338ec21bb0e9ee05a54c8 Change-Id: I1e155bcf4a6a7ff1b49338ec21bb0e9ee05a54c8
2025-03-24Merge "Add border API to surface control" into main Cairn Overturf
2025-03-20Remove ScopedAddToTraversalPath Patrick Williams
ScopedAddToTraversalPath is an RAII wrapper that copies the existing traversal path, modifies it, and then restores the modified properties from the copy when deleted. It's simpler to make the child path a copy and not modify the parent. Bug: 403312802 Flag: EXEMPT refactor Test: presubmits Change-Id: I8f06ed557f29444be6df51c1c8ea60958a82ee95
2025-03-19Add border API to surface control YCairn Overturf
See go/sf-box-shadows-api for more details Bug: b/367464660 Flag: com.android.window.flags.enable_border_settings Test: atest SurfaceFlinger_test Change-Id: I1190edb97693004d9f46058fd0165451470a65b3
2025-03-11Merge "Force snapshot update when requested transform changes from invalid ↵ Treehugger Robot
to valid" into main
2025-03-11Force snapshot update when requested transform changes from invalid to valid YCairn Overturf
An early out in snapshot builder prevents parent properties from being propagated to children when the parent is hidden (e.g. due to invalid transform). So we need to force update children snapshots when the parent becomes visible (i.e. transform becomes valid). I tested removing the early out but the added benchmark takes 2us longer. Bug: 319757092 Flag: EXEMPT bug fix Test: atest libsurfaceflinger_unittests Change-Id: I9c9a996bbc3de4e7f8cbfc947a99cdccae5090b9
2025-03-06Merge "Revert "Don't force client composition when rounded corners are ↵ Cairn Overturf
cached"" into main
2025-03-06Revert "Don't force client composition when rounded corners are cached" Cairn Overturf
This reverts commit c7e3e0c1d284f76155020d09b1a9ac65ea18f1b3. Reason for revert: b/398131325 Change-Id: I5870678cb8a69457e0a4a197a8cb67128e104399
2025-03-03Provide classes that logically make up a transaction with == and !=. Anton Ivanov
Primarily this change is intended to support writing test assertions. As a side effect, make some improvements to encapsulation of members. Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: I51352c78ccfcb0fc6bff655593d7d31771516668
2025-02-13Log snapshot's secure status in SurfaceFlinger dumpsys. Yi Jiang
Change-Id: Iab5a7ea94b7c2de503c5ec3fa63cd64cde071397 Test: locally verified the logs Flag: EXEMPT log only update Bug: 372558540
2025-02-11Don't force client composition when rounded corners are cached YCairn Overturf
Also tweak client composition summary characters so that all composition types correspond to a unique character. Example with a few freeform windows open Before: Layers: 19 [b:brrrr]r[R:rrrrrr]R[R:bbb] After: Layers: 19 [b:brrrr]r[r:rrrrrr]R[r:bbb] There are 2 fewer client composited layers. See go/shadow-caching for more examples. Bug: 391428079 Test: Open a few freeform windows and take a perfetto trace. Ensure layers with rounded corners are being Flag: EXEMPT bug fix Change-Id: I88752bd6e03f531d3c7ed004cc085a255c4dc67c
2025-02-06Merge "Remove client drawn shadow code" into main Cairn Overturf
2025-02-05Demarcate cached sets in composition summary Cairn Overturf
Previously, the composition summary indicated that HWC was compositing more layers than it actually was. Example when youtube video open and playing in a free form window Before: bbrrrRrbbb After: [b:brr]r[R:rbbb] So there are 2 cached sets and 1 uncached set. One cached set and one uncached layer is composited by HWC, the other cached set is composed by the GPU. Bug: 391428079 Flag: EXEMPT log only update Test: Capture perfetto trace and confirm layers are skipped and overridden as expected Change-Id: I4ffda43f5248ef8bb690cdaca0eeca7ffac3d997
2025-01-28Remove client drawn shadow code Cairn Overturf
Shadows will continue to be drawn by surfaceflinger Bug: 391428079, 375624570 Change-Id: Ic527a091e77d69c6e9529782d283379a2651dea8 Test: Shadows work in free form mode Flag: com.android.window.flags.ignore_corner_radius_and_shadows
2025-01-24Merge "Include color layers in input list to fix tapjacking vulnerability" ↵ Wenhui Yang
into main
2025-01-23Include color layers in input list to fix tapjacking vulnerability Wenhui Yang
We can use this to compute occlusion more accurately in inputdispatcher. Bug: 277076451 Test: app-debug.apk in the bug Test: go/wm-smoke Flag: EXEMPT bugfix Change-Id: I1e155bcf4a6a7ff1b49338ec21bb0e9ee05a54c8
2025-01-22Revert the change of unifying visibility Wenhui Yang
Fixes: 305254099 Flag: com.android.graphics.surfaceflinger.flags.skip_invisible_windows_in_input Test: libgui_test.InputSurfacesTest Change-Id: Ibadb7f9c60438474c3f7c15a17ee3ad0d8c61ac0
2025-01-10Merge "Rounded corner: fix layer settings when inherited from parent ↵ Treehugger Robot
settings" into main
2025-01-10Rounded corner: fix layer settings when inherited from parent settings Surbhi Kadam
This fixes a bug where the radius inherited from parent settings were not scaled correctly. Also adds a unit test to test this scaling behavior in the future. Bug: 388410825 Test: atest surfaceflinger_unittest; manual - open PiP capable apps Flag: EXEMPT bugfix Change-Id: Ib63e27a75d3facecef94d8723b6cbdbe0cae6c27
2025-01-08Trace critical workloads Vishnu Nair
Create a new trace track and trace all important work that happens on the main thread. Keep track of changes in workload as transaction are queued and committed to infer when the CPU load will increase from the last frame. This CL only logs the workload. Flag: EXEMPT logs Bug: 333623207 Test: perfetto Change-Id: Ib423d1968545adc89172bd0e40fbde2a31b46ddf
2025-01-07Merge "surfaceflinger: Add clientDrawnCornerRadius and ↵ Surbhi Kadam
clientDrawnShadowLength layer properties" into main
2025-01-06surfaceflinger: Add clientDrawnCornerRadius and clientDrawnShadowLength ↵ Surbhi Kadam
layer properties Modify RoundedCornerState and ShadowSettings to account for client drawn corners and shadows. When equal to the requested values, SurfaceFlinger will not draw corners and shadows for the layer. Bug: 375624570 Flag: com.android.window.flags.ignore_corner_radius_and_shadows Test: atest SurfaceFlinger_test; manual test - PIP, freeform window, recents, app launch Change-Id: Idde115b51a253a34cfadfbd1ff6c7b15c44518ef
2025-01-06Use the cloned window's layer stack space for raw coordinates Prabir Pradhan
Use the cloned window's layer stack (screen) space as the raw coordinate space for input going to clones. This ensures the raw coordinates are consistent between the clone and cloned windows while mirroring. Flag: com.android.input.flags.use_cloned_screen_coordinates_as_raw Test: Presubmit Bug: 377846505 Change-Id: I7370ac64585315d9c754eaa1eb0077c8555fc6a9
2024-12-19Rename TransactionState to QueuedTransactionState Vishnu Nair
Clean up some of the logic tracking transaction state on the client. This will help with some of the upcoming optimizations, remove some duplicate parceling code and clean up the interface into SF. Flag: EXEMPT refactor Bug: 385156191 Test: presubmit Change-Id: I701138535000af921e8e026855cd420ff5c8aeea
2024-12-13Merge "Invert content priority so that higher value is higher priority" into ↵ Brian Lindahl
main
2024-12-13Invert content priority so that higher value is higher priority Brian Lindahl
Bug: 337330263 Test: atest SurfaceControlPictureProfileTest Flag: com.android.graphics.libgui.flags.apply_picture_profiles Change-Id: I50126161e7f3a457f432c433a5d3964489465bea
2024-12-11Update visibleForInput to make gesture monitor visible in input list Wenhui Yang
Fix the error introduced by unifying the concept of visibility, some layers (e.g. gesture monitor) is invisbile in the composition list, but need to be visible in input list. Fixes: 305254099 Flag: com.android.graphics.surfaceflinger.flags.skip_invisible_windows_in_input Test: libgui_test.InputSurfacesTest.input_ignores_color_layer_alpha libgui_test.InputSurfacesTest.input_respects_container_layer_visiblity android.view.surfacecontrol.cts.SurfaceControlInputReceiverTests.testRemoteSurfaceControlReceivesInput Change-Id: I403e69e62169699829185992c3c4c87275159111
2024-11-16Merge "Skip invisible windows in input list" into main Wenhui Yang
2024-11-15Skip invisible windows in input list Wenhui Yang
To reduce traffic sent over binder and the number of copied objects in native code, we decide to remove windows from WindowInfosListener that are not visible because input doesn't need to know about the windows that aren't visible, and invisible windows don't affect the operation of other windows. Fixes: 305254099 Test: adb shell su root dumpsys SurfaceFlinger Test: atest LayerSnapshotTest Flag: EXEMPT bugfix Change-Id: I1ccc29565ee92277a703d16c07fd1141d6df6862
2024-11-11Merge "Allow apps to apply picture profiles with priority to layers" into main Brian Lindahl
2024-11-09[Lut HAL backend] implementation 3rd patch. Sally Qi
- interpret the lut and pass them into shader. Bug: 329472856 Test: builds Flag: EXEMPT no flag needed Change-Id: I005600593f4a369130bf8bcaea69300758b5ae03
2024-11-08Allow apps to apply picture profiles with priority to layers Brian Lindahl
Bug: 337330263 Test: build Test: atest LayerSnapshotTest Flag: com.android.graphics.libgui.flags.apply_picture_profiles Change-Id: I1adb6069d0168084abf0a76d310abb4ffad5ce5f
2024-11-05Merge "Update output's dirty region when content changes" into main Vishnu Nair
2024-11-05Update output's dirty region when content changes Vishnu Nair
Correctly track content changes and update the output's dirty region. The region is used to update the virtual display contents. If the changes are not tracked, we may fail to update the virtual display surface. Fix by tracking the content changes at the layer as well as accounting for inherited parent layer changes. Flag: EXEMPT bugfix Test: atest com.google.android.gts.cast.VirtualDisplayHostTest#testTestActivityEmbeddingOnVirtualDisplay --rerun-until-failure Bug: 360050020, 338403827 Change-Id: Iea4d8bbf0e5d478e908daafb10d13432d524da77
2024-10-28Include PID and UID in offscreen hierarchy dumping Wenhui Yang
Fixes: 374625249 Test: adb shell su root dumpsys SurfaceFlinger Flag: EXEMPT bugfix Change-Id: I725aee1405f29c7e1db61d939cbd4abb8e3bc3d9
2024-10-25Add documentation for layer drawing order Vishnu Nair
Flag: EXEMPT documentation Bug: 375586809 Test: presubmit Change-Id: I223df292a6a52dcdc096296e3691d64bb87a33fb
2024-10-23Merge "[Lut HAL backend] implementation 2nd patch" into main Sally Qi
2024-10-22[Lut HAL backend] implementation 2nd patch Sally Qi
1. add gui/DisplayLuts.h structure. Mimic DisplayLuts.java. 2. add Lut parameter into Layer side. When SurfaceControl#setLuts is called, in native code, the lut information is passed to SurfaceFlinger and RenderEngine side via LayerState::eLutsChanged. 3. in OutputLayer::updateCompositionState, we compare the Lut requested from the app and the Lut from the HWC to decide GPU composition or not. 4. DPU or GPU composition? If the Lut from the app exactly matches the Lut from the hwc, do DPU. Otherwise, GPU composition instead. Bug: 329472856 Test: libcompositionengine_test Flag: NONE HAL backend interface change Change-Id: I8295fe419c6237d90b7ff9f02f62bafd6cd2cecf
2024-10-09Merge "Track pendingBuffer count in RequestedLayerState" into main Melody Hsu
2024-10-09Track pendingBuffer count in RequestedLayerState Melody Hsu
Allows for easier retrieval without added lock contention. RequestedLayerState stores a pointer to the original buffer count from legacy layer. Bug: b/294922229 Test: presubmit Flag: EXEMPT, mechanical refactor Change-Id: Iaab1b2214cc670f6e2d385ba4aba31e635a34030
2024-10-04Merge "Support floating point values for layer crop" into main Vishnu Nair
2024-10-03Support floating point values for layer crop Vishnu Nair
Flag: EXEMPT bug fix Fixes: 310950423 Test: presubmit Change-Id: I05feb4881a95bc8caad90a3d632b3c7881909bf3
2024-09-25Use Layer IDs instead of handles in BufferCountTracker Melody Hsu
Allows more versatility in looking up buffer counts by layer ID. Layer handles will not always be available for lookup. Test: presubmit Bug: b/294922229 Flag: EXEMPT pure refactoring Change-Id: Ifba8b19f24f3f3cf35d247490a17fe3b8c4920e0
2024-09-20Fix the input info missing for SurfaceView Wenhui Yang
Layer snapshots with buffers but without inputinfo were not sent to input or other window info listeners. This was due to a bug in how we checked to see if the layer needed an input info. FIx this to send SurfaceView layers to window info listeners. Fixes: 365167765 Test: LayerSnapshotTest Test: LayerLifecycleManagerTest Flag: EXEMPT bugfix Change-Id: I49e5d1e503af860a8324cc8b36589748ca2b7a25
2024-08-28Remove legacy layer hierarchy Vishnu Nair
Legacy layer objects are now all stored in the mLegacyLayer map. They are created on the binder thread and destroyed on the main thread. Cloned layers do not have a legacy layer. This change also keeps the create layer alive until main thread wakes up to make the lifetime a bit simpler to track. Flag: EXEMPT flag removal Bug: 330785038 Test: presubmit Change-Id: I4132e7a7c373c823ad914209955f7b0f55af008d
2024-08-15Adapt addClientLayer to LayerHierarchy. qinyige1
Method addClientLayer still traverses mDrawingState, which is not adapted after LayerLifecycleManager enabled. Dump info through LayerHierarchyBuilder. Flag: EXEMPT bugfix Bug: 341641452 Test: Manual Change-Id: I781696548138dfcb1ec3e463a32ae5b399f10eac
2024-08-15Fix dirty region updates if a layer becomes invisible Vishnu Nair
Ensure we correctly update the output layer's dirty region if a layer becomes invisible. Flag: EXEMPT bug fix Bug: 330785038 Test: presubmit Change-Id: I38c501320316babe6ba12c49d9d542c4f6103aaa
2024-08-05Fix framerate propagation from child to parent layers Vishnu Nair
We were not resetting the framerate vote of the parent layer after the child frame rate vote was removed. Fix this and add tests to verify this behavior does not regress. Flag: EXEMPT (removing old flags) Bug: 330785038 Test: presubmit Change-Id: I88d60484d4dfdfa4b09c98484867a49545f60257
2024-07-30Remove legacy layer gamemode Vishnu Nair
Use gamemode data from snapshots when possible. Also fixes a bug where gamemode was not updated when the hierarchy changed. Flag: EXEMPT (removing old flags) Bug: 330785038 Test: presubmit Change-Id: I25f839d34d1e73ad4dbf90e64134eea216ec5614