Commit Graph

4323 Commits

Author SHA1 Message Date
Seigo Nonaka
8ae6cd8c72 Merge "Make Typeface member final" into sc-dev 2021-02-26 06:00:42 +00:00
Seigo Nonaka
fb6ea1e786 Merge "Use currentTimeMillis instead of epoch seconds" into sc-dev 2021-02-26 05:59:58 +00:00
Seigo Nonaka
9537f89a42 Use currentTimeMillis instead of epoch seconds
Bug: 179215598
Test: N/A
Change-Id: I1fc16750c42b0ce5a2206b928fcf153109d56cb4
2021-02-25 12:31:15 -08:00
Seigo Nonaka
4560edffbe Make Typeface member final
Bug: 179448958
Test: N/A
Change-Id: I577eaf9ae5cf209899381c8807b5400119487296
2021-02-24 17:45:25 -08:00
Siarhei Vishniakou
554afe2691 Merge "Add presentTime to FrameInfo" into sc-dev 2021-02-24 20:38:17 +00:00
John Reck
3b1ded1768 Merge "Wire up SurfaceView stretch effect" into sc-dev 2021-02-22 22:30:29 +00:00
Nader Jawad
28e62f371a Remove unreleased BlurShader API
Remove BlurShader API which was part of the initial
implementation blur that internally mapped between
SkImageFilter and SkShader. Because we migrated
away from this approach to leverage SkImageFilter
directly as part of the RenderEffect API, BlurShader
is no longer applicable and consumers should use
RenderEffect.createBlur instead.

fixes: 180766802
Test: builds
Change-Id: Ibbe6360c66b8e3718cac4516130336f5758cbd3e
2021-02-19 18:44:46 -08:00
Siarhei Vishniakou
4bcbffd584 Add presentTime to FrameInfo
Present time is available to apps, but is not currently stored inside
FrameInfo. In this CL, we add a location for storing the present time inside
FrameInfo.

Currently, the metrics reporter is triggered after the buffer is sent to
SurfaceFlinger. That means, metrics for anything that happens after gpu
draw completes are currently not available.

In a future CL, we will populate the 'presentTime' field.

In a future CL, we will register a metrics observer inside ViewRootImpl
in order to send this data to InputDispatcher. This will enable
end-to-end touch latency metrics collection.

Bug: 169866723
Test: printed present time inside FrameTimeline.cpp (surfaceflinger
side) and compared to the values printed inside a metrics observer
registered in ViewRootImpl (not done in this CL)
Test: atest ViewFrameInfoTest

Change-Id: I7d0f8c5d7b5a2572abdc4e107123e8938a36f582
2021-02-18 22:07:09 +00:00
John Reck
5d53a7540a Wire up SurfaceView stretch effect
Bug: 179047472
Test: StretchySurfaceViewActivity

Change-Id: I7f3d582cc66fb732a557e9332edc6d186db2335c
2021-02-17 15:44:50 -05:00
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