Commit Graph

4611 Commits

Author SHA1 Message Date
Bo Liu
6a3fc60f43 Switch HWUI to use native performance hint API
Test: None
Bug: 194204196
Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
2021-07-22 11:33:01 -04:00
Huihong Luo
eb93107b57 Add a sys prop to control WebView Overlays support
The boolean system property is named as "debug.hwui.webview_overlays_enabled"

Bug: 192267127
Test: change the property value, check presence of Webview Surface
Control

Change-Id: I01e3e26282a5fa79aa504a6e49c5abe1a1c3ea02
2021-06-30 11:47:21 -07:00
Huihong Luo
7580a2dd98 Merge "Fix a crash caused by transaction" into sc-dev 2021-06-24 20:27:48 +00:00
Huihong Luo
4df4151bc0 Fix a crash caused by transaction
A native transaction passed from webview is sent back to native side, so java side does not manage the life cycle of the transaction.

Bug: 191414767
Test: Play a video, switch to another app, wait for 10 seconds
Change-Id: I013052c202b445438d6cb6497f5f9a2fc22a2b85
2021-06-24 11:10:06 -07:00
Jay Aliomer
4508c4ab85 Fix ripple radius calculation
Fixes: 191608957
Test: manually using the material showcase app
Change-Id: I3a89d200a842b3dd5f34ffc94a2c62c6fab9436e
2021-06-24 12:19:38 -04:00
Huihong Luo
17410b668f Merge "Fix z-order for webview surface control" into sc-dev 2021-06-18 19:53:34 +00:00
Jay Aliomer
ccc98b8d6e Merge "Update patterned ripple mask when changed" into sc-dev 2021-06-18 17:57:57 +00:00
Huihong Luo
34f42fdecd Fix z-order for webview surface control
Set the root surface control transparent, and set the z order of the newly created child surface control to -1.
A new callback is needed to update root surface control in sync from Java side.

Bug: 186750329
Test: use latest APKs from Webview team, play a video, mini toolbar should be visible
Change-Id: I0b37ee8f83fd2b41ff4f2856dbadd31ff6170baf
2021-06-18 10:14:22 -07:00
Jay Aliomer
b7eab7fee6 Merge "Fix invalid ripple bounds" into sc-dev 2021-06-18 03:31:35 +00:00
Huihong Luo
fec5e82e69 Merge "Fix potential ASurfaceTransactionCallback leaks" into sc-dev 2021-06-17 16:32:06 +00:00
Jay Aliomer
88114108ee Update patterned ripple mask when changed
Fixes: 188601242
Test: visual
Change-Id: I036564223e27a5630151ef2a9a5a81b29e291a49
2021-06-17 01:00:45 -04:00
Lucas Dupin
8bdce16ce4 Fix invalid ripple bounds
Test: manual
Fixes: 188112758
Change-Id: I6e23c02adc4761fde2e69bafc341066be15f63ee
2021-06-17 00:18:05 -04:00
John Reck
85933d4c55 Fix ripples not going away
Fixes: 191141356
Test: ripples on calculator
Change-Id: Icabf80914c5ba9c0649e69ef0fa67c03d6ad5cdd
2021-06-16 15:48:33 -04:00
Huihong Luo
1d88151a38 Fix potential ASurfaceTransactionCallback leaks
Change the rerferene to java object from global reference to weak
reference.

Bug: 188555236
Test: check number of ViewRootImpl objects from Systrace
Change-Id: I52347b9efb211691826635d046259bc3c54b194f
2021-06-16 09:47:04 -07:00
TreeHugger Robot
7395d119e6 Merge "Put starting the animation back inside state changed check" into sc-dev 2021-06-14 17:01:42 +00:00
John Reck
7c0a17c042 Put starting the animation back inside state changed check
Only start or stop the ripple if the state changed.
Avoids accidentally starting 2 ripples when the overall
state set changed but the state_activated specifically did
not.

Fixes: 188062293
Test: manual
Change-Id: If32f1ee5ad3e7294e2e6924b1a4a0e4070c8bcfc
2021-06-10 16:42:26 -04:00
TreeHugger Robot
15cc80b39c Merge "Use RobotoStatic-Regular for the weight 400 of roboto family" into sc-dev 2021-06-08 17:57:30 +00:00
Lucas Dupin
6e9adc7f5c Merge "Isolate focus color filter" into sc-dev 2021-06-07 22:47:20 +00:00
Lucas Dupin
562e3d6af1 Isolate focus color filter
The mask color filter has an alpha applied to it, it should not be used
on the focused states.

Focus works differently, where the alpha is defined by the state itself
(20% for hover, and 60% focus,) combined with the paint alpha.

Test: adb shell input keyevent 22
Test: manual on list item (not masked)
Test: manual on button (masked)
Fixes: 184717563
Change-Id: I01b8540face638330d016b413e70f2b74ce5592c
2021-06-07 12:13:17 -07:00
Seigo Nonaka
cec02064d4 Merge "Calculate set of available fonts in native" into sc-dev 2021-06-03 23:26:17 +00:00
Seigo Nonaka
d5ecababb4 Calculate set of available fonts in native
The previous attempt[1] of improving SystemFonts API is not good enough
for users. To further improve the performance, calculate font uniqueness
in native code. From Android S, the system font information is stored
in native code and has more information for skipping duplication check.

Bug: 188201287
Test: atest FontFamilyUpdateRequestTest
Test: atest FontListParserTest
Test: atest FontManagerTest
Test: atest NativeSystemFontTest
Test: atest PersistentSystemFontConfigTest
Test: atest SystemFontsTest
Test: atest SystemFontsUniqueNameTest
Test: atest UpdatableFontDirTest
Test: atest UpdatableSystemFontTest
Test: minikin_tests
Change-Id: Ib375dcda0f278c93ec8dd21636d7a22b4174f214
2021-05-27 15:54:24 -07:00
Lucas Dupin
da517d5370 Merge "Revert "Enable dithering on RippleDrawable"" into sc-dev 2021-05-27 19:07:56 +00:00
Lucas Dupin
2a5d63d8bd Revert "Enable dithering on RippleDrawable"
This reverts commit 1cbfc3b00b.

Reason for revert: CL was no-op
Bug: 189281134
Change-Id: I2c70b51dd1d2f679a8310b1847675360ce415d35
2021-05-27 19:07:35 +00:00
Lucas Dupin
5941f0fb95 Merge "Enable dithering on RippleDrawable" into sc-dev 2021-05-26 20:39:09 +00:00
Lucas Dupin
9f6fb354e8 Constant sparkle scale
Drawables from different themes are yielding different densities.
Framework themes are returning 160 (DENSITY_MEDIUM), while AppCompat
is reporting 420 (DENSITY_420.)

This is causing the sparkles to have completely different sizes on
the same device, which is wrong.

Fixes: 189236372
Test: manual
Change-Id: Ia79e360123cf740aaba85d5348f07604c2b39026
2021-05-26 09:31:24 -07:00
Lucas Dupin
1cbfc3b00b Enable dithering on RippleDrawable
Per UX request, given that gradients started to show some banding.

Test: manual
Fixes: 189281134
Change-Id: I8898f2463c6e07c390c07c242b6632dcbb9c3ef3
2021-05-26 09:13:51 -07:00
Seigo Nonaka
18c044d31b Use RobotoStatic-Regular for the weight 400 of roboto family
Bug: 189235998
Test: Manually done
Change-Id: I253a72df5641b57d371598cec6853737c5e98ba9
2021-05-25 14:09:52 -07:00
Lucas Dupin
2011da8730 Merge "New shader parameters" into sc-dev 2021-05-25 18:54:21 +00:00
Lucas Dupin
8a7d4e2b2a New shader parameters
- Fading out sparkles earlier
- New density and size for sparkles
- Overall timing tweaks
- New turbulence parameters

Test: manual
Fixes: 188453593
Fixes: 188454455
Change-Id: I70e364c84cc04f653618ea811a817d9f82895af5
2021-05-25 09:35:17 -07:00
Seigo Nonaka
9c16cc5a3e Merge "Skip buffer equality check for SystemFonts" into sc-dev 2021-05-21 05:03:38 +00:00
Seigo Nonaka
5abd5dfd9d Skip buffer equality check for SystemFonts
All system font files are file backed and stored in the unique place,
so no need to compare the buffers during creating sets of system fonts.

Bug: 188201287
Test: atest FontFamilyUpdateRequestTest
Test: atest FontListParserTest
Test: atest FontManagerTest
Test: atest NativeSystemFontTest
Test: atest PersistentSystemFontConfigTest
Test: atest SystemFontsTest
Test: atest SystemFontsUniqueNameTest
Test: atest UpdatableFontDirTest
Test: atest UpdatableSystemFontTest
Change-Id: I4a4680937988c013aaa4e4fa729e61ac8514c513
2021-05-20 15:56:43 -07:00
TreeHugger Robot
395e8c9997 Merge "Fix RadialGradient Javadocs" into sc-dev 2021-05-18 20:53:44 +00:00
Nader Jawad
33ceaf8f95 Fix RadialGradient Javadocs
Fixed issue where Javadoc references
were not displayed and the list
of circumstances in which exceptions
would be thrown was not separated
by line breaks

Fixes: 188102023
Test: N/A
Change-Id: Ibdba7c26e053bdba5d8cff21f1cb7c0764f5a4f1
2021-05-18 12:16:23 -07:00
Nader Jawad
85cf59de2f Merge "Add support to toggle different shader behaviors" into sc-dev 2021-05-18 16:27:47 +00:00
Nader Jawad
93d6e248de Add support to toggle different shader
behaviors

Updated HWUI to toggle overscroll stretch
implementation based on whether the
device supports high end graphics
or not

Bug: 187718492
Test: manual
Change-Id: I13a91a8861c07bec8af43268ba22d0f5b7060b4f
2021-05-17 22:42:15 -07:00
Lucas Dupin
fdda357925 Correctly initialize the noise phase
To make it move smoothly throughout the animation

Fixes: 186130728
Test: manual
Change-Id: I78bb220f72238f13b21055c5874ce8b829171b5d
2021-05-17 16:28:31 -07:00
Seigo Nonaka
09439752da Add perf test for SystemFonts.getAvailableFonts
Bug: 188201287
Test: atest SystemFontsPerfTest
Change-Id: Id08a53e980a012a682e95e7b41d363aae31c1232
2021-05-14 13:55:55 -07:00
Kohsuke Yatoh
048d4b1788 Close FDs / mmap handles promptly.
Currently we rely on GC to close them.
This may cause system_server crash depending on the timing of GC.

Bug: 187879195
Test: atest UpdatableSystemFontTest
Change-Id: I09ac3f349e5ec100e4164320cbf27977474cc4bb
2021-05-13 16:23:55 +00:00
Joe Hsu
c73c098665 Merge "Check FontFamily null before adding it." into sc-dev 2021-05-13 01:59:02 +00:00
Lucas Dupin
b52611aa8a Merge "Blend premultiplied colors" into sc-dev 2021-05-12 20:08:16 +00:00
Lucas Dupin
0ec7ddeba8 Blend premultiplied colors
Mixing alpha blended colors, and then premultiplying them in the end was
causing artifacts on the sparkles.

Bug: 187824279
Test: visual
Change-Id: Icde12c3fa737f597f18f2705eefa687a49a19445
2021-05-12 11:14:03 -07:00
joehsu
1681aa2eeb Check FontFamily null before adding it.
Missing ttf files under /product/fonts will cause NullPointerException.
This CL fixes it.

Bug: 187901462
Test: Flash Sabrina to Android S. Boot to check if there's still an error.
Change-Id: I9d39c2a6e4730563f35f43176f630ac0439767b3
2021-05-12 14:18:58 +08:00
Jordan Demeulenaere
47c51fe80e Enable {ANTI_ALIAS,DITHER}_FLAG by default (1/2)
Test: atest android.graphics.cts.PaintTest
Bug: 186644628
Change-Id: I5d5d03e430af380e23016c6deba5eca46067a22b
2021-05-11 17:40:08 +02:00
TreeHugger Robot
6836ab8607 Merge "Update ripple mask when invalidated" into sc-dev 2021-05-07 16:30:33 +00:00
Lucas Dupin
1cc81e18f6 Merge "Fix sparkle alpha blending" into sc-dev 2021-05-07 15:08:22 +00:00
Lucas Dupin
b73fa47929 Merge "Adding force-dark support to RippleDrawable" into sc-dev 2021-05-07 01:08:43 +00:00
Lucas Dupin
a79111e05c Fix sparkle alpha blending
We should not blend between the fill alpha and the sparkle alpha.
This would cause the sparkle pixel to have lower opacity than the fill,
when the fillAlpha > sparkleAlpha.

We do need to blend the fill and sparkle colors, but their alphas need
to be combined separately.

In the end we then premultiply the alpha into the color.

Test: manual
Bug: 186130682
Change-Id: I519f6c797839feda14e714c7375ee727aba2cf8b
2021-05-06 17:45:59 -07:00
Lucas Dupin
00af5271da Adding force-dark support to RippleDrawable
Add force-dark support to RippleDrawable by modifying the ink color.

Test: manual
Test: atest CanvasOp
Fixes: 186130682
Change-Id: I89eaaf3afa5ec53a74d2d08de8cff6484e55a912
2021-05-06 15:17:02 -07:00
Brad Stenning
1be127b866 Update Icon find shared library resources
Icon is building its own resource object and not including the default flag that would allow for including of shared-lib resources

Bug: 187332041
Test: Manual
Change-Id: I121b5f75cbe7d125f8adddb30c84024e2b1a80c7
2021-05-05 21:09:34 +00:00
Jay Aliomer
5121e27f89 Update ripple mask when invalidated
When a child drawable is updated, the invalidated mask
needs to reflect on the animation paint

Fixes: 187290156
Test: visual
Change-Id: I30065027f73f646c887933648d8e296ec651c299
2021-05-05 16:14:04 -04:00