Commit Graph

43 Commits

Author SHA1 Message Date
Luca Zuccarini
a96dcb0cc7 Remove redundant instances of depth controller.
During each app launch, a new `MyDepthController` is instantiated, which
registers two of its methods as listeners for cross window blur and
opaqueness. This controller's usefulness spans that specific animation
only, but the listeners are never unregistered. This creates conflicts
when an opaqueness signal happens, which cause the background to flicker
(see videos).

Bug: 283335820
Test: manual, see videos in the bug
Flag: not needed, bug fix
Change-Id: I3dcb0b8ff0aa77bf3183a926889d0131b17bcaa4
2023-05-23 15:33:17 +00:00
wilsonshih
146e81b8c2 Polish reveal animation after onTasksAppeared.
Showing the animation leash of appearedTaskTargets if there need to
play the reveal animation behind splash screen view.
Pausing applyDepthAndBlur while playing splash screen exit animation
from launcher side, otherwise the app window would be blurred.

Bug: 277704255
Test: manual, do quickswitch to start the app behind splash screen
view, verify no flicker or blur happen when playing reveal animation.

Change-Id: I83604ceeaeb54ab2100fdabf45a1624644b85e37
2023-04-20 14:47:51 +08:00
Sunny Goyal
d859060860 Merging MultiValueAlpha with MultiPropertyFactory
Bug: 246644619
Test: Presubmi
Change-Id: Id5abc5f3169544656f1139ae17ca59e34ac65dac
2022-10-24 14:38:18 -07:00
Alex Chau
950a10738b Fix STATE_DEPTH stuck at 1 after setting wallpaper
- Made BaseDepthController.setDepth/mDepth private, all get/set should be done through STATE_DEPTH or WIDGET_DEPTH
- Generified ClampedDepthProperty into Utilities.ClampedProperty to apply on STATE_DEPTH

Bug: 240580498
Test: Go to walppaper&style, set new wallpaper, then go to widget picker, wallpaper depth should transition smoothly
Change-Id: I53cdedf970fd7ffba6a952c4edf4b34251b01f07
2022-10-18 17:07:17 +01:00
Alex Chau
3d2c062567 Change wallpaper depth in widget picker
- Also changed widget picker open/close duration, refactored the values into DeviceProfile
- Generalized MultiAdditivePropertyFactory to accept aggregator as parameter

Bug: 240580498
Test: manual
Change-Id: I6886ca514593e404b8d7b0e8ed44f20ec2b77c73
2022-09-13 12:20:56 +08:00
hyunyoungs
91ca748819 Fix blurry wallpaper when user locks on all apps surface
Bug: 242746421
Test: manual

TL;DR;;
setState toState= NORMAL called when locking screen on ALLAPPS screen
but mSurface==null
hence depth is not reset to NORMAL state

Change-Id: I26a37f7de8b0ecd481b36eebf07e1b79f8b0035c
2022-08-31 22:05:45 -07:00
Sunny Goyal
ced159075c Fixing surface blur when using multiple surfaces
Separating the depth controller logic into a base
class so that different controllers can be used
for different surfaces

Bug: 236780815
Test: Verified locally
Change-Id: I2bd7ed50438453d6e41c73c8001a0d6a73091653
2022-07-19 16:06:34 -07:00
Lucas Dupin
4d90868075 Add flag that disables depth on overlay scroll
Test: manual
Fixes: 229261804
Change-Id: I132d9b5ca78255447ca72655b0a1fb1a4f86c3a1
2022-04-14 14:06:11 -07:00
Winson Chung
871759483b 1b/ Replace removed shared lib calls with direct calls
Bug: 219861883
Test: Builds
Change-Id: I7831d0de14286c9fa39fed59b168535e0a70d94d
2022-02-24 18:04:02 +00:00
Lucas Dupin
b9f7e269a9 Be forgiving with accidental horizontal scroll
An accidental horizontal touch, due to vertical fling on the -1 screen
could lead to imperceptible change in zoom, and send a frame to client
composition. This CL adds extra padding to overlay scroll amount, to
avoid these accidental gestures.

Bug: 211245940
Test: https://ui.perfetto.dev/#!/viewer?trace_id=3260c116-c578-6dad-e047-0a327b7d346c
Change-Id: Id05e482c79c1dcc2e1ba73baf8a4a4101797bbd2
2022-01-28 14:58:02 -08:00
Lucas Dupin
03064a1e60 Directly assign mDepth
A request to set a new depth is ignored if the surface is currently
invalid. We should cache what was the requested value, so it will be
applied once the surface is valid again.

Test: manual
Fixes: 209028986
Change-Id: I812816da4b0139c7ea7b53a9fb00f11265ecdea8
2022-01-13 12:01:11 -08:00
Winson Chung
6526973952 Prevent setting launcher layer has opaque when there is content behind
- This can prevent the layered content behind to not be visible (and
  since launcher draws a cutout and the wallpaper isn't shown, may
  result in a black rect.  We only specialize for this case while
  Launcher is in Overview.
- Also don't need to defer updating drawsBelowRecents, this can result
  in the state not being reflected since it runs after the last update
  of the transform params

Bug: 205789573
Test: Swipe up from app and ensure behind layers are visible (also
      ensure this doesn't affect blur during the swipe or optimizations
      after you leave overview)
Change-Id: I07689b3d9b65708797576e5fbefe12fb1f544119
2021-11-23 05:21:31 +00:00
Lucas Dupin
01c362bb6c Dump DepthController internals
Add DepthController to dumpsys, so it's easier to debug any future
issues.

Bug: 198732728
Test: adb shell dumpsys activity com.google.android.apps.nexuslauncher
Change-Id: Ifa7fe1d7fcb375cacc907d0da9524a2ee2a2677d
2021-09-10 22:57:24 +00:00
Lucas Dupin
512f95131c Merge "Dispatch blur radius for BACKGROUND_APP state" into sc-v2-dev 2021-08-30 20:33:57 +00:00
Lucas Dupin
937eff0e76 Dispatch blur radius for BACKGROUND_APP state
When entering BACKGROUND_APP, it's possible that the blur radius will be
lost. We need to dispatch it on the first possible frame, otherwise
Overview won't have blurs.

Fixes: 196828055
Test: enter overview multiple times
Test: pull up all apps
Test: open app from home or all apps
Change-Id: I5920e1b28e2d23421863ecd59845e902040d126c
2021-08-27 18:10:41 +00:00
Lucas Dupin
b4f899fd9a Don't avoid blurring overview
The app window is now on top of the scrims, so we can just mark the
window as opaque and keep blurring.

Bug: 196828055
Test: atest OutputUpdateAndWriteCompositionStateTest
Test: systrace on all app, and overview
Change-Id: I128d3b4722060c0bb72a218bf01ba26dabaddacf
2021-08-26 22:30:34 +00:00
Lucas Dupin
0c70dbdc5e Synchronize surface transaction
Until now the SurfaceControl transaction was being applied
asynchronously, which could lead to it being executed out of sync with
launcher drawing.
This became an issue at higher refresh rates, where frames are produced
at a much faster pace.

In order to fix this issue, we can use BLAST transactions, which are
annotated with a frame number.

Test: record video, go through it manually
Fixes: 194320152
Change-Id: I1636a1ded4f9dd84c54ba12239e3549b92ed7567
2021-08-24 14:17:59 -07:00
Lucas Dupin
b259a896f5 Constrain scroll amount
Test: scroll vertically and horizontally
Fixes: 196309367
Change-Id: Ibf16fb72cf95e29ed820d5f511e764a388c93bb0
2021-08-13 15:57:41 -07:00
Lucas Dupin
f006d37acf Merge "Act on scrim visibility" into sc-v2-dev 2021-08-11 02:59:05 +00:00
Lucas Dupin
e4a9469156 Act on scrim visibility
The scrim visibility drives whether the launcher window is opaque or
not. We should track it and apply the flag instead of trying to catch it
through other Launcher life cycles.

Fixes: 195365607
Test: tap on home button while launching app from overview
Change-Id: I2a00b86b602b5dd12c901433b92adcf0170be15e
2021-08-10 14:18:50 -07:00
Lucas Dupin
6d80cafc68 Merge "Add depth to -1 screen" into sc-v2-dev 2021-07-28 21:40:42 +00:00
Lucas Dupin
87d752062e Add depth to -1 screen
Wallpaper will zoom out as you drag the overlay

Test: manually pull overlay
Fixes: 192502999
Change-Id: I9067b70d10497d4e16a5ef601161fbedfa9307e1
2021-07-28 12:36:31 -07:00
Lucas Dupin
4a7acaed37 Request early wake-up when zooming
This way we'll be less likely to jank on 120Hz devices.

Test: manual
Fixes: 194680560
Change-Id: Ieff93f234701649514f8905c20c19cef231c816b
2021-07-26 11:19:39 -07:00
Lucas Dupin
ee9099af7f Revert "Apply depth even when surface is null"
This reverts commit a6c38be150.

Fixes: 193333562
Test: manual
Change-Id: I4fae079e0cd056fc800e5a15389f4795c77e17fb
2021-07-20 14:14:50 -07:00
Lucas Dupin
20a13047ae Use launcher surface when removing launch target
Otherwise events won't be dispatched properly and window opacity will be
wrong.

Test: manual
Fixes: 191149025
Change-Id: Ice7ea86252282c7dc1cb5925dd1bdb8cade89c08
2021-07-02 17:39:10 -07:00
Lucas Dupin
0f00c35268 Decouple zooms and blurs on app launch
We'd like to be able to disable blurs during app launch, but without
disabling zooms as well. The previous sysprop would set the depth of
BackgroundAppState to 0, when what we want is to conserve wallpaper
zoom.

Bug: 191969790
Test: adb shell setprop ro.launcher.blur.appLaunch false
Change-Id: Ie4b26096f6ac723c3981bba2829557e6cc6c733b
2021-06-29 13:02:12 -07:00
Lucas Dupin
b60fff3929 Disable blurs when dev setting or battery saver
Stop rendering blurs whenever a user:
- disables blurs on developer settings
- enables battery saver

Test: manual
Bug: 191814337
Change-Id: I8fd04796054d92171732c8db95b64cfa3ec469ec
2021-06-23 08:37:27 -07:00
Lucas Dupin
a6c38be150 Apply depth even when surface is null
We need to update mDepth even when the surface is null, otherwise
events will be ignored and mDepth will have the wrong value when
waking up from screen-off.

Test: pull up app drawer, screen off, unlock
Test: go to overview, screen off, unlock
Test: launch app, observe blurs and zoom
Fixes: 191153501
Change-Id: I33f5d84a50e24f05a09769b1f7f3c27969f847cd
2021-06-21 16:27:11 -07:00
Lucas Dupin
258e4526b7 Remove blur from launcher when in overview
The App window will be under Launcher, so we can't actually blur
launcher at that time, otherwise the live window will also be blurred.

Test: manual
Bug: 189207458
Change-Id: Ie07449d29d3b0dc60d3787b6d32aa9e46e0bb613
2021-06-04 11:05:37 -07:00
Lucas Dupin
6e50860616 Set blur on effect layer during app launch
Test: manual
Fixes: 189207458
Change-Id: I8fabba92c6831c2fd54fe08156fc9a9b5d141a56
2021-06-01 11:07:17 -07:00
Lucas Dupin
0c6341af99 Make launcher opaque when scrim becomes opaque
This will help with overdraw, because we don't need to draw the
wallpaper.

Test: manual
Test: adb shell dumpsys SurfaceFlinger --timestats -dump
Bug: 187703092
Change-Id: I2ebae94725578e5f4d640cd6b45da3f4d1f21a20
2021-05-20 14:33:39 -07:00
Jon Miranda
d8cc458867 Remove reliance on surface to update depth
- Also no longer resets depth on surface change, as depth is independent
  from blur.

This fixes the bug where depth is not accurately reflected.

Bug: 185680609
Bug: 185189176
Test: launch app and swipe home multiple times
      launch app and back gesture to home

Change-Id: I5e2f4ce08b8bf84b7356fbd080ae732875c5e04e
2021-04-26 14:42:44 -04:00
Tony Wickham
6cd95cd2d8 Remove Overview atomic animation support
- Remove PLAY_ATOMIC_OVERVIEW_SCALE and PLAY_ATOMIC_OVERVIEW_PEEK
- Remove complicated parallel atomic animation support from
  AbstractStateChangeTouchController and subclasses
- Remove some code related to going between Overview <-> AllApps

Test: Swipe between states in all 3 navigation modes
Bug: 175137718
Change-Id: Ice314d46946c3a983cdc6ccf1a67effb5da9156e
2021-03-29 11:59:06 -07:00
Jon Miranda
36d1015997 Add depth animation when multiwindow mode changes.
This is a workaround until we can support app transitions when starting
an activity in mw mode.

Bug: 158613217
Change-Id: I843d6669722c543728ab532e1c4fbd4643f6f135
2020-06-19 16:36:57 -07:00
Jon Miranda
7c57559930 Gates blur code behind BlurUtils#supportsBlursOnWindows.
This "fixes" the bug where wallpaper zoom does not reset to 0 when
screen turns off since we no longer require a valid surface to set the depth
when blur is disabled.

Note that the bug still exists when blur is enabled, which will need to be
fixed in a follow up CL.

Bug: 157946272
Change-Id: I43179435885c95eb2ecf406fa5c291badf5a1ed3
2020-06-12 11:03:10 -07:00
TreeHugger Robot
62382c3f95 Merge "Update home to overview depth interpolator to match other motion" into ub-launcher3-rvc-dev 2020-06-02 20:18:01 +00:00
Tony Wickham
10c2b4f9d9 Update home to overview depth interpolator to match other motion
Overview comes in and workspace goes out at overshoot(1.2), so
the wallpaper depth/blur should match that speed.

Test: go to overview from home in 3 button or 0 button mode,
ensure wallpaper scales down at the same rate as other elements

Bug: 154637581
Change-Id: I03254fa3fdf19f468852bed8aab7ba21203c429a
2020-06-01 14:36:46 -05:00
Jon Miranda
84f6e0182e Fix depth jumping around during transitions.
This is caused because we use mDepth for depth comparisons, but there are
cases where we set mDepth but we do not pass that value to WallpaperManager
(ie. surface is null or not valid) and that leads us into
inconsistent states.

Bug: 155780358
Change-Id: I3faf14416d5783ad472892425eb0bd37dd469a46
2020-05-29 13:06:55 -07:00
Sunny Goyal
35e7d38681 Abstracting out state handler logic into base classes so that it can
also be used in different activity

Change-Id: Ic5e60b21e1429c71f1cd4e7041e70bf4fc9761b7
2020-05-11 16:38:26 -07:00
Lucas Dupin
264cb2ff68 Do not blur if all apps is fully visible
Fixes: 155093795
Fixes: 155203546
Test: manual
Change-Id: I30f4c027e5107a199791e908acbb7ffed94e6a77
2020-04-29 17:49:02 +00:00
Winson Chung
20aeddd853 Dedupe non-perceptable depth updates
Bug: 154304487
Change-Id: I6d96aca555932f4a51aed576d25f7150952bb562
2020-04-17 16:16:44 -07:00
Jon Miranda
dc186e68a1 Add AnimationFlag for SKIP_DEPTH_CONTROLLER.
We use this flag to prevent the depth from being immediately set to 0 when
preparing to animate home.

Bug: 152327671
Change-Id: I614c6ae08b9f9e56ecb94fb51748791a38504583
2020-04-15 15:19:49 -07:00
Sunny Goyal
284a6cfdd7 Removing base no-op implementation of depth controller
Change-Id: Ibf46c0a147d2772033ad469b803e606376978cd7
2020-03-24 16:11:06 -07:00