summaryrefslogtreecommitdiff
path: root/graphics
AgeCommit message (Collapse)Author
2022-05-07Implement Inter Dynamic Metrics for system UI fontDanny Lin
Inter, our system UI font of choice, works best with the official Dynamic Metrics. The font's default spacing makes text relatively sparse compared to Roboto, Google Sans Text, and other common UI fonts. Dynamic Metrics optimizes tracking (letter spacing) based on font size to improve appearance. Spacing is increased for small text and decreased for larger text, making it generally more compact and closer to Apple's SF Pro. Math.exp is relatively expensive, so use a precalculated lookup table for common sizes (up to 32dp). The LUT follows steps of 0.5dp so we can safely use integer casting. For compatibility, only the default system UI font is affected, and only if spacing is unset (null or 0). Change-Id: I48642f05f4b60b07326f657aaac76d968465a5dd
2022-05-05Paint: Enable subpixel text positioning by defaultDanny Lin
On desktop Linux, subpixel text positioning is necessary to avoid kerning issues, and Android is no different. Even though most phone displays have relatively high DPIs, the lack of subpixel text positioning is only unnoticeable on high-end devices such as the Pixel 4 XL (1440x3040 @ 6.3 in => 537 dpi). For example, on the Pixel 5 (1080 x 2340 @ 6.0 in => 432 dpi), horizontally-scrolling labels in QS tiles can be seen "jittering" slightly upon close observation. This was tested with the Google Sans font on Google's stock OS. At this lower DPI, there is still a need for subpixel text positioning (at least in some cases). Enable subpixel text positioning by default to fix occasional kerning issues and jittering when text is in motion. Change-Id: I8d71e5848a745c5a2d457a28c68458920928ee09
2022-05-05ripple: Replace with Fluent Design-inspired ripple animationDanny Lin
This is a new GLSL ripple animation inspired by Microsoft's Fluent Design, with an emphasis on responsiveness. The first frame of the animation includes a solid base highlight and a visible portion of the ripple circle, together serving as immediate feedback on finger up (especially in cases where few additional frames can be rendered, e.g. opening activities/fragment and dismissing dialogs). After the initial frame, the animation consists of a blurred circle that gradually expands (increasing radius), becomes less blurred, and finally fades out at the end of the animation. The animation timing follows a sine-based ease out curve, which is a decent balance between the animation feeling too fast and too slow/unnatural. Demo video: https://twitter.com/kdrag0n/status/1445806323535269893 Change-Id: I27192bd406490c39487dc84941f2f5c4a0fb33fe
2022-03-15Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
2021-12-22Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: Ic2889f5eb531008340529eadc36ec8efc62b1984
2021-12-13Merge mpr-2021-11-05Eric Arseneau
Change-Id: If7c68a17857eee4194f28413b938d5647820162c
2021-10-08ImageFormat: Fix YCBCR_P010 bitsPerPixelShuzhen Wang
For P010 format, Each pixel has Y and subsampled CbCr. So: bitPerPixel = 1.5 * bitPerPixelY bitPerPixelY = 16 bits Bug: 200949749 Test: Camera CTS CRs-Fixed: 3027052 Change-Id: I7964d64c25961dbef634ac1ef82898147ec57111
2021-09-23ImageFormat: Fix YCBCR_P010 bitsPerPixelShuzhen Wang
For P010 format, Each pixel has Y and subsampled CbCr. So: bitPerPixel = 1.5 * bitPerPixelY bitPerPixelY = 16 bits Bug: 200949749 Test: Camera CTS Change-Id: I7964d64c25961dbef634ac1ef82898147ec57111
2021-08-26Filter Alias which points non-existing font family nameSeigo Nonaka
The FontFamily will be removed if none of font files exist on the device. Bug: 192479819 Test: atest FontListParserTest Change-Id: I36f6476fe37bc04ec8737936747385c63908d651 (cherry picked from commit 691cfe8818513e576300cdb963a65341984659c4)
2021-08-13Merge "Remove bitwise plane information from ImageFormat's P010 docs" into ↵Alec Mouri
sc-dev
2021-08-12Remove bitwise plane information from ImageFormat's P010 docsAlec Mouri
Some vendors may prefer a different underlying layout for P010 in the future compared to the one currently supported in gralloc. In particular, it's not a guarantee that the CB/CR plane is contiguous in memory with the Y plane. Bug: 195570363 Test: builds Change-Id: I01eea78b8555610470959cdb4f0f9ceb16e80f73
2021-08-11Merge SP1A.210811.001Brian Orr
Change-Id: I5aa7cf27a3a3cc16830c9947a826e30a0da481c4
2021-08-09Merge "Do not turn on dithering by default" into sc-devLeon Scroggins
2021-08-09Do not turn on dithering by defaultLeon Scroggins III
Bug: 195281495 Test: Ief7025c21f365ae90fa63120f1cc82e0695901af This is a partial revert of 47c51fe80e3dd9d6b518c11c2e1714c271835af5/ I5d5d03e430af380e23016c6deba5eca46067a22b. The intent was to bring today's rendering implementation in line with the old HWUI implementation, which always dithered gradients by default. However, when dithering is enabled, the Skia implementation dithers more than just gradients (e.g. Bitmaps). Combined with poor performance of the dithering algorithm on certain GPUs, this led to a performance regression on key apps. Change-Id: Id54121091e2cc47131dc9b5ae67bd638fbc005fc
2021-08-06Merge SP1A.210803.001Scott Lobdell
Change-Id: I09253f8614e9ee85a59460f3ef25f17dd98cac80
2021-08-05Merge "Do not run background animation without a Looper" into sc-devLucas Dupin
2021-08-05Do not run background animation without a LooperLucas Dupin
Apps that create RippleDrawable on a background thread could crash, making them incompatible with S. Test: manual with MindBody app Fixes: 194952073 Change-Id: I9d16d5c63c192e96191b4fbc859ff3bc3da733cb
2021-08-04Have RippleDrawable ignore non-attached RenderNodesJohn Reck
Don't try to do a RenderNodeAnimation if the RenderNode isn't attached. Although this isn't strictly speaking a valid state to be in, it's also easy for RippleDrawable to just ignore it. Bug: 186864959 Test: ripples still show up, are still RT accelerated normally Change-Id: I8127f1419508157eb83ac9bb1562745ac53d2ced
2021-08-02Merge "SurfaceView: Synchronize destframe updates with SurfaceView size ↵Vishnu Nair
changes" into sc-dev
2021-07-30SurfaceView: Synchronize destframe updates with SurfaceView size changesVishnu Nair
This CL fixes one of the issues with SurfaceView parent frame and content syncing. With BLAST, we have two surface controls each setting a scale. The parent surface control sets a scale based on the requested surface size and the SurfaceView layout size. The BlastBufferQueue surface control scales the buffer to the requested buffer size if the buffer has the appropriate scale mode. The destination frame controls the second scaling and it must be applied with the parent surface scale changes. This cl fixes flickers where the requested fixed surface size changes without any view size changes. This cl allows the caller to pass in a transaction to BLASTBufferQueue#update which is updated with the destination frame changes. This transaction can then be applied with the parent surface changes. This also fixes an issue where destination Frame was being set on every buffer update and when we updated the BlastBufferQueue size. Since buffer transactions can be queued up on the server side, a stale value maybe applied for a few frames causing flickers. Fixes: 194458377 Test: bug repro steps Test: atest SurfaceViewSyncTest#testSurfaceViewSetFixedSize Change-Id: I118bd1c3942b389e3951c3fd7389403895fc7b31
2021-07-29Reset patterned animations when solid ripple is resetJay Aliomer
Fixes: 194655257 Test: visual using the material demo app + MX player Change-Id: I47805fe1a36bdadd7de45008c42cf2fcb23d223a
2021-07-27Merge SP1A.210723.002Scott Lobdell
Change-Id: I220cdfc5cb9db40162fd33f400a54591018d54cf
2021-07-22Switch HWUI to use native performance hint APIBo Liu
Test: None Bug: 194204196 Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
2021-07-14Merge SP1A.210709.002Haamed Gheibi
Change-Id: I4610885d5d770d858895057cdd9fea387a5e33dd
2021-07-09Merge SP1A.210624.001Scott Lobdell
Change-Id: I96a39cdca22771b76e89caebd53ed52416005092
2021-06-30Add a sys prop to control WebView Overlays supportHuihong Luo
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-24Merge "Fix a crash caused by transaction" into sc-devHuihong Luo
2021-06-24Fix a crash caused by transactionHuihong Luo
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-24Fix ripple radius calculationJay Aliomer
Fixes: 191608957 Test: manually using the material showcase app Change-Id: I3a89d200a842b3dd5f34ffc94a2c62c6fab9436e
2021-06-23Merge SP1A.210618.002Scott Lobdell
Change-Id: I72d03812a8377fc014aebad8db4e68eeded2d531
2021-06-21Merge SP1A.210616.001Daniel Norman
Change-Id: I9acdc955f698dbebb8fad19cfd5cb71fcdd27b45
2021-06-18Merge "Fix z-order for webview surface control" into sc-devHuihong Luo
2021-06-18Merge "Update patterned ripple mask when changed" into sc-devJay Aliomer
2021-06-18Fix z-order for webview surface controlHuihong Luo
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-18Merge "Fix invalid ripple bounds" into sc-devJay Aliomer
2021-06-17Merge SP1A.210604.001Brian Orr
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
2021-06-17Merge "Fix potential ASurfaceTransactionCallback leaks" into sc-devHuihong Luo
2021-06-17Update patterned ripple mask when changedJay Aliomer
Fixes: 188601242 Test: visual Change-Id: I036564223e27a5630151ef2a9a5a81b29e291a49
2021-06-17Fix invalid ripple boundsLucas Dupin
Test: manual Fixes: 188112758 Change-Id: I6e23c02adc4761fde2e69bafc341066be15f63ee
2021-06-16Fix ripples not going awayJohn Reck
Fixes: 191141356 Test: ripples on calculator Change-Id: Icabf80914c5ba9c0649e69ef0fa67c03d6ad5cdd
2021-06-16Fix potential ASurfaceTransactionCallback leaksHuihong Luo
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-14Merge "Put starting the animation back inside state changed check" into sc-devTreeHugger Robot
2021-06-10Put starting the animation back inside state changed checkJohn Reck
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-08Merge "Use RobotoStatic-Regular for the weight 400 of roboto family" into sc-devTreeHugger Robot
2021-06-07Merge "Isolate focus color filter" into sc-devLucas Dupin
2021-06-07Isolate focus color filterLucas Dupin
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-03Merge "Calculate set of available fonts in native" into sc-devSeigo Nonaka
2021-05-27Calculate set of available fonts in nativeSeigo Nonaka
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-27Merge "Revert "Enable dithering on RippleDrawable"" into sc-devLucas Dupin
2021-05-27Revert "Enable dithering on RippleDrawable"Lucas Dupin
This reverts commit 1cbfc3b00bd058e8bddd93cd5fc9b4e0b985420e. Reason for revert: CL was no-op Bug: 189281134 Change-Id: I2c70b51dd1d2f679a8310b1847675360ce415d35