Commit Graph

4464 Commits

Author SHA1 Message Date
Jay Aliomer
d9b1c7486d Merge "Implementing the new material ripple" into sc-dev 2021-02-16 21:38:47 +00:00
Jorim Jaggi
814951f27e Merge "Add SurfaceControl to hwui" into sc-dev 2021-02-16 20:11:45 +00:00
Kohsuke Yatoh
d3279fa99c Merge "Add FontManager#updateFontFamily() API." into sc-dev 2021-02-16 18:32:58 +00:00
Jay Aliomer
f8ecd4850f Implementing the new material ripple
Fixes: 167177623
Test: RippleDrawableTest
Change-Id: Ic3962760bc9a53c82f66b267bd5aa5006c09fa00
2021-02-16 13:07:48 -05:00
Huihong Luo
5fdf7b8d26 Add SurfaceControl to hwui
add a method, setSurfaceControl, for java layer to pass surface control to the render thread

Bug: 173671170
Test: call setSurfaceControl method in ViewRootImpl.java
Change-Id: I886a79c377938f19cf38b9058f2bec64e1439000
2021-02-16 17:38:12 +01:00
Kohsuke Yatoh
c2008e8aac Add FontManager#updateFontFamily() API.
Bug: 179103383
Test: atest CtsGraphicsTestCases:FontFamilyUpdateRequestTest
Test: atest CtsGraphicsTestCases:FontFileUpdateRequestTest
Test: atest CtsGraphicsTestCases:FontManagerTest
Test: atest FrameworksServicesTests:UpdatableFontDirTest
Test: atest UpdatableSystemFontTest
Change-Id: I0103784c72d60567675daf73e95e4d716f091e4a
2021-02-16 07:06:33 -08:00
Seigo Nonaka
5dd6dd5507 Keep source ID into native object
To avoid static field and synchronization for the mapping, keep source
identifier into native font instance.

Bug: 179113771
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases CtsGraphicsTestCases
Change-Id: I238e7b8090ee89101937ec22cbe7c68aea97bcfd
2021-02-13 18:23:47 -08:00
TreeHugger Robot
4c417f3bde Merge "Preload Roboto-Regualr.ttf" into sc-dev 2021-02-14 01:37:16 +00:00
Seigo Nonaka
1dbb19432e Preload Roboto-Regualr.ttf
Bug: 179026427
Test: N/A
Change-Id: I47cf1f0d86ca93cfef429ed2f3af8e60d68d385b
2021-02-13 14:03:09 -08:00
TreeHugger Robot
7a063e67e9 Merge "Register native allocation for Font" into sc-dev 2021-02-13 22:00:03 +00:00
Philip P. Moltmann
8d6a0cb6af Merge "Remove me from OWNERS files" am: 25ee5a7fb7 am: bf8de269cb am: 39198ddd84
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573324

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I429557a8537fb6417fcb9539978964ade75c8dee
2021-02-11 23:15:42 +00:00
Philip P. Moltmann
39198ddd84 Merge "Remove me from OWNERS files" am: 25ee5a7fb7 am: bf8de269cb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573324

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibe2c5fd92070b1aebdc46755c8667b3ed22348ab
2021-02-11 22:57:48 +00:00
Seigo Nonaka
44fa7cbf7e Register native allocation for Font
In the ag/13482285, accidentally removed font native allocation.
The native bound instance should be unref-ed when the Java font
object is GC-ed.

Bug: 179942558
Test: N/A
Change-Id: I19312844856f19a2e3abf717a7563a0812c9266d
2021-02-11 14:53:37 -08:00
Philip P. Moltmann
a8eb3d3e69 Remove me from OWNERS files
Test: n/a
Change-Id: I6113011e6ab0997285d5b7a86303fc60a3b98a2b
Exempt-From-Owner-Approval: Previously approved
2021-02-11 22:28:43 +00:00
Seigo Nonaka
e7cada6dc2 Merge "Update SystemFonts.getAvailableFonts returns updated font files" into sc-dev 2021-02-11 06:43:05 +00:00
Winson Chung
d0c7c20e88 Merge "Save and pass last snapshot data with recents task info" into sc-dev 2021-02-10 18:57:41 +00:00
Seigo Nonaka
5916647c83 Update SystemFonts.getAvailableFonts returns updated font files
Bug: 179113771
Test: atest CtsTextTestCases CtsGraphicsTestCases
Change-Id: I46cccffaf4b9e743ea54f0ef7e41ee88a6a48e79
2021-02-10 00:38:07 -08:00
Winson Chung
71718ad748 Save and pass last snapshot data with recents task info
- Adds task & snapshot sizing info to RecentTaskInfo so that SysUI can
  stably layout overview when there are tasks of different sizes
- Removing some unused code

Bug: 179466077
Test: atest WmTests:RecentTasksTest
Change-Id: Idf4c27e2d04380328413459fc537ff8bcc111a14
2021-02-09 22:10:10 -08:00
Ady Abraham
aa92c8daf3 Merge "Remove render ahead from hwui" into sc-dev 2021-02-09 22:28:40 +00:00
Kohsuke Yatoh
5d2f4fc3b3 Merge "Add FontListParser#writeFamily()." into sc-dev 2021-02-09 07:54:43 +00:00
TreeHugger Robot
317c0ae14c Merge "Make Font class being able to create from native instance" into sc-dev 2021-02-09 01:14:05 +00:00
Kohsuke Yatoh
f91ea1b201 Add FontListParser#writeFamily().
Bug: 179103383
Test: atest FrameworksCoreTests:FontListParserTest
Change-Id: I992acd13dc5dc084a00ee9f3832c4d7111ecd4e4
2021-02-08 16:16:56 -08:00
Ady Abraham
7bb70faa04 Remove render ahead from hwui
As HWUI uses vsync id to send buffers to SF, SF applies the right
amount of render ahead by latching the buffers at the configured time.

Test: launch an app and observe systrace
Bug: 178148035
Change-Id: Ifd3e1a2971aad0a085cb35d33e950194046aa634
2021-02-08 18:13:45 +00:00
Nader Jawad
011aac8328 Add RenderEffect support for Shaders as inputs
Added RenderEffect.createShader to handle creation
of RenderEffects using shaders as inputs that can be
chained with other RenderEffects

Fixes: 178536866
Test: Added example in HwAccelerationTest activity
Change-Id: I4d9791ad63f3057ffa528918ce2cd083986089e5
2021-02-08 17:35:21 +00:00
Seigo Nonaka
1dd39f3bde Make Font class being able to create from native instance
This CL refactors followings:
- Use infomation stored in native instance as the source-of-truth.
- Being able to create Font instance from native instance.
- Use ByteBuffer as a wrapper of the native byte buffer.

Bug: 179113771
Test: atest CtsTextTestCases CtsGraphicsTestCases
Test: atest android.graphics.fonts.NativeSystemFontTest
Test: atest android.graphics.fonts.SystemFontsTest
Test: atest FrameworksCoreTests:android.text
Test: atest FrameworksCoreTests:android.graphics
Change-Id: Icc1df1c76ba78d4f8800984444439fd03970e179
2021-02-05 19:15:29 -08:00
TreeHugger Robot
d26fd028b6 Merge "Reduce the memory usage in system_server" into sc-dev 2021-02-05 09:22:11 +00:00
TreeHugger Robot
241f3b293b Merge "Add support for 10-bit YUV P010 ImageFormat" into sc-dev 2021-02-05 06:18:27 +00:00
Seigo Nonaka
96d9c64752 Reduce the memory usage in system_server
SystemFonts and related classes are now aggressively used in system
server. To reduce the memory impact, use ArrayMap/Set instead of
HashMap/Set.

Also, the language tags are duplicated in two places, one in Java and
one in Native object. Remove Java reference.

Bug: 178472803
Test: N/A
Change-Id: Id94b68bd34a1958fda67512dcdc683b20b12003f
2021-02-04 16:42:18 -08:00
Seigo Nonaka
99c0756123 Save locale list to Font instance
Bug: 179113771
Test: minikin_tests
Test: atest CtsTextTestCases CtsGraphicsTestCases
Change-Id: Ief70131d381f83432a4ac91b7aeef5413343479a
2021-02-03 21:39:18 -08:00
Galia Peycheva
f83b52cc13 Revert "Make BackgroundBlurDrawable a SystemApi"
Revert "Add permission check for blurs in SurfaceFlinger"

Revert "Remove public usages of FLAG_BLUR_BEHIND"

Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Test: m
Change-Id: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
Merged-In: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
2021-02-02 23:02:05 +01:00
TreeHugger Robot
b23f6d71ee Merge "Move GameManager to android.app package." into sc-dev 2021-02-02 19:36:13 +00:00
John Reck
7cf75f0b15 Merge "Add stretch plumbing" into sc-dev 2021-02-02 14:49:42 +00:00
John Reck
5cb290bf54 Add stretch plumbing
Bug: 179047472
Test: builds & boots

Change-Id: I30b5d6683160af598f98555f61af1cf5a7639bbe
2021-02-01 14:41:07 -05:00
Peiyong Lin
235cb5086c Move GameManager to android.app package.
Bug: b/177611751
Bug: b/178112303
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Icf01f723f1323f6f91030e6005958b7da05e8177
2021-01-29 20:58:52 -08:00
Peiyong Lin
72036e758c Merge "Add GameManager service." into sc-dev 2021-01-29 23:47:19 +00:00
Peiyong Lin
32f6ff7e15 Add GameManager service.
GameManager service is a service to manage game related features. This
patch creates the initial service to manage the game mode and persist
the data across reboot.

Bug: b/174956354
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Iee2ab47c79d29f48847bc6d4b3eb781a5af18ff4
2021-01-29 09:18:34 -08:00
Siyamed Sinir
30900cac3f System font check for downloadable font
Adds a new attribute to downloadable font xml
that checks if downloaded font is on the system
already and uses that instead.

Test: added new tests
Test: atest ResourcesTest
Test: atest FontResourcesParserTest

Bug: 178589784
Change-Id: Ib7c32ba3037c534e9ab8c144716d68e46c908a39
2021-01-28 20:05:11 +00:00
TreeHugger Robot
7142180435 Merge "Implement AnimatedImageDrawable#setBounds" into sc-dev 2021-01-28 18:50:25 +00:00
Seigo Nonaka
9387e7f4cd Add more shell command for font
Bug: 173619554
Test: atest UpdatableFontDirTest PersistentSystemFontConfigTest FontManagerTest
Change-Id: I25917fa9e8c42742f74222f25c5ba68d96a2c2fd
2021-01-27 22:59:06 +00:00
Emilian Peev
fd37b04a35 Add support for 10-bit YUV P010 ImageFormat
Bug: 147711411
Test: Camera CTS
Change-Id: I44f61b44f1cc67e079417e72415a26c0793ab5e8
2021-01-27 17:30:49 +00:00
Leon Scroggins III
be969efdb0 Implement AnimatedImageDrawable#setBounds
Bug: 160617841
Test: If6edcada514977c2f08c29927380d35000173dc5

AnimatedImageDrawable.java:
- Override onBoundsChange. Silently do nothing if mNativePtr is 0. This
matches setRepeatCount, setAutoMirrored, and onLayoutDirectionChanged.
While some other methods throw an IllegalStateException, doing nothing
is safer for backwards compatibility.

AnimatedImageDrawable.h:
- Add Properties.mBounds. Putting it here provides a safe way for the UI
thread to change it, like it does for other properties (alpha, color
filter).
- Remove redundant "virtual" modifiers on "override" methods.

hwui/AnimatedImageDrawable.cpp:
- Initialize mStagingProperties.mBounds to use the intrinsic bounds. The
official documentation requires a client of Drawable to call setBounds,
but AnimatedImageDrawable as introduced in P started with the intrinsic
bounds. This ensures we maintain that behavior without special casing a
client that never calls the method.
- Handle the bounds, using a scale and translate
- Update the SkAutoCanvasRestores to save, removing the need to manually
determine whether it's necessary to call save().
- Update onGetBounds to return SkRectMakeLargest. This matches
RenderNodeDrawable and ReorderBarrierDrawables. Since the Drawable may
be updated by a call to setBounds to draw anywhere, this ensures the
bounds always contains the drawing.

jni/AnimatedImageDrawable.cpp:
- Plumb the new bounds to the native object.

Change-Id: If8d7ed51a56e0f64714f15e6041ed883e8ce23f8
2021-01-27 16:54:03 +00:00
Seigo Nonaka
46d6a3f9ce Add FontManager API and font manager shell commands
FontManager is an interface of communicating with FontManaserService.
With this CL, system apps can know the primitive information about
what font files are installed and how it is configured.

This CL also adds shell command of dumping font configuration.
Example usages are:

  # dump primitive font configuration.
  adb shell dumpsys font

  # dump fallback font list
  adb shell cmd font dump serif

Bug: 173619554
Test: atest FontManagerTest
Test: Manually confirmed above commands works.
Change-Id: I5cb855308e199ac38bd7b56b60821346247bdce3
2021-01-25 08:51:41 -08:00
Kohsuke Yatoh
4fc6b1a86b Merge "Use fs-verity for protecting updatable font files." 2021-01-22 16:05:12 +00:00
Kohsuke Yatoh
755199eab1 Use fs-verity for protecting updatable font files.
- Updatable font files should have fs-verity enabled.
- PostScript name metadata is checked to detect if files are swapped.
- Font revision metadata is checked to detect if version downgrade
  happens.

Bug: 176939176
Test: atest FrameworksServicesTests:UpdatableFontDirTest
Change-Id: Ie59012e17ef4f9db2419db259e0773067ace4120
2021-01-21 11:00:20 -08:00
Seigo Nonaka
7cdfcd8a87 Merge "Add utility method for identifying font type." 2021-01-21 17:58:54 +00:00
Seigo Nonaka
9d5ab7e41a Add utility method for identifying font type.
Bug: 176939176
Test: atest FontFileUtilTest
Change-Id: Iaf4e23128ee274c2beb10280eb64ba73e6bc2ad8
2021-01-20 22:50:09 -08:00
Chavi Weingarten
857a3713bb Merge "Remove preserve surfaces when surface format changes." 2021-01-20 22:08:10 +00:00
Wale Ogunwale
c04c4c1098 WindowContainerTransaction for setting adjacent roots
Ability to specify that 2 root tasks are adjcent there by allowing them
to occlude their parent. Similar to how the legacy primary/secondary
split windowing modes are used to occlude their parent.

Also, occlude parent if a child in multi-window mode as a matching
bounds.

Bug: 177166639
Test: AppConfigurationTests#testSplitscreenPortraitAppOrientationRequests
Change-Id: I7d54bfa188700a76b0bca911d2011123c21553ad
2021-01-20 06:37:04 -08:00
Galia Peycheva
f78234f112 Merge changes from topic "blur_system_api"
* changes:
  Make BackgroundBlurDrawable a SystemApi
  Make window background blurs SystemApi
  Add permission for blur SystemApi
2021-01-20 05:04:01 +00:00
Seigo Nonaka
f5859819cd Refactor font parser for making SystemApi.
This CL breaks system font initialization step into three sub-steps
to be able to expose font configuration as SystemApi. The font
initialization step is now following three steps:
 1. Parse XML files. This is SystemFonts#getSystemFontConfig and
    SystemFonts#getSystemPreinstalledFontConfig. The first API gives
    you the current FontConfig and the second API gives you plain
    vanilla FontConfig without any updates.
 2. Build font family fallback list from FontConfig. The font family
    fallback is a intermediate state that can be used for custom
    Typeface. This state is kept for dumping in shell command later.
    This is useful for checking what font will be used by the fallback
    since family fallback is still printable.
 3. Build typeface mapping. The typeface mapping is the final state to
    be used by application. This is no longer printable.

Bug: 173619554
Test: atest TypefaceTest TypefaceSystemFallbackTest StaticLayoutTest
Test: atest CtsGraphicsTestCases CtsTextTestCases
Change-Id: I4e21fc7c41f2fb7975d03c1d5f5536a23e8abb09
2021-01-19 15:55:41 -08:00