Commit Graph

10616 Commits

Author SHA1 Message Date
Alec Mouri
fe7538bf8e Merge "[DisplayEventDispatcher] Kick DisplayEventDispatcher out of libandroidfw." 2019-12-03 23:25:14 +00:00
Mike Reed
6a8bf8e9e2 use new SkPathFillType enum
Test: make

Change-Id: I8f20b7da284483ea4f59e35d9c3d48202cba02d5
2019-12-03 13:01:12 -05:00
TreeHugger Robot
db644b952e Merge "switch to new SkPathDirection enum" 2019-11-26 19:43:07 +00:00
Alec Mouri
7d77ff827c [DisplayEventDispatcher] Kick DisplayEventDispatcher out of libandroidfw.
DisplayEventDispatcher will live in libgui for now, as a shim over
DisplayEventReceiver. This is so that we can keep libgui out of the
UI-renderer module while we can work on stabilizing the interface with
libandroidfw for asset management required by graphics classes.

It also doesn't make much sense to have display-event functionality in a
separate grab-bag library, especially when there's two users, and
there is potentially an opportunity to somehow merge with
DisplayEventReceiver to simplify code a bit.

Change-Id: Ife0f9c8ad2053437087fdbf0618b892928ce6864
Bug: 142760698
Test: builds
2019-11-25 13:49:32 -08:00
TreeHugger Robot
9876e5bbcb Merge "[HWUI] Grab preferred WCG format from ADisplay" 2019-11-25 19:22:34 +00:00
Mike Reed
15760c9db7 switch to new SkPathDirection enum
Test: make

Change-Id: If88814c12d12280d362078c1d8bc7f66558f82e2
2019-11-25 12:59:46 -05:00
TreeHugger Robot
f4eb2ca0d7 Merge "Fix for Surface#lockHardwareCanvas lockups" 2019-11-22 19:12:36 +00:00
TreeHugger Robot
003340d401 Merge "Stop loading animation for addtional cursor type." 2019-11-22 02:42:55 +00:00
Garfield Tan
3906d1dd0f Stop loading animation for addtional cursor type.
In the test below it only expects MockSprite#setIcon() being called
once, but with animation it may be called multiple times.

Bug: 144947344
Test: atest PoitnerControllerTest#updatePointerIcon
Change-Id: I5c4908fb8301cae144fd637c831f2012a35862e3
2019-11-21 16:42:13 -08:00
John Reck
cd18c2271d Fix for Surface#lockHardwareCanvas lockups
By avoiding setting a dequeue buffer timeout we avoid
hitting a different path in BufferQueue that prevents
async behavior from happening. This restores P's
behavior in this path.

Bug: 143860379
Test: repro app in bug
Change-Id: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
2019-11-21 15:16:08 -08:00
Winson
d9d1736767 Overlayable actor enforcement
Validates that the caller of an OverlayManager API that mutates state
is actually allowed to act on the target as defined in the target's
overlayable tag.

<overlayable name="MyResources" actor="namespace/name">

An actor is valid if any of the following is true:
 - is root/system
 - is the target overlay package
 - has the CHANGE_OVERLAY_PACKAGES permission and an actor is not defined
 - is the same package name as the sole resolved Activity for the actor specified
     in the overlayable definition, with only pre-installed, namespaced actors
     currently supported

Bug: 119442583
Bug: 135052950

Test: atest SystemConfigNamedActorTest
Test: atest com.android.server.om

Change-Id: If56b9e8366852eaef84f6bb25c3e6871eaa3f219
2019-11-21 12:01:41 -08:00
Alec Mouri
70f2a92e4f [HWUI] Grab preferred WCG format from ADisplay
* Removes the SurfaceComposerClient dependency from DeviceInfo
* Removes libui dependencies from DeviceInfo.

Bug: 144505134
Test: builds, boots, launch settings
Change-Id: I5eb8b296ff274ca2affafedf6f2fd13fd75469b9
2019-11-21 10:22:21 -08:00
TreeHugger Robot
9f43c201fe Merge "Do not look for R.class of overlays" 2019-11-14 19:04:48 +00:00
Ryan Mitchell
73bfe41bab Do not look for R.class of overlays
Now that RROs are loaded as shared libraries,
LoadedApk#makeApplication is attempting to find the onResourcesLoaded
method of the overlays. This is a performance hit and causes more
memory than necessary to be allocated during application start up.

Bug: 143314947
Test: com.android.performance.tests.HermeticMemoryTest
Change-Id: I3b8cd22dae83e0164d6678c80279f9fffceb34e6
2019-11-13 14:51:14 -08:00
Tej Singh
5918429fa2 Java API for pulled atoms
This creates a java API for registering pullers. Will implement the
statsd side in a follow up CL.

Test: builds, boots
Change-Id: Ib6735984297ce3148839a6370a3c15b2a585baf5
2019-11-13 13:22:27 -08:00
Stan Iliev
10689992cf Fix an issue with GPU stats not enabled
Invoke Surface::enableFrameTimestamps after eglDestroySurface.
eglDestroySurface internally disables time stats. Order is
important, when CanvasContext::setSurface is invoked with
a surface, that is already current (which happens all the time).

Test: ran UiBench microbenchmark tests
Change-Id: I3d023c3a87da6329c556426d553c744e541b9dff
2019-11-13 11:48:04 -05:00
TreeHugger Robot
e385ff5067 Merge "Decouple SurfaceTexture from HWUI" 2019-11-11 21:45:04 +00:00
Nathaniel Nifong
dc19a65297 Remove unused argument 'layers' from renderFrameImpl and renderOverdraw
Test: Flashed Pixel 3 and viewed home screen.

Change-Id: I2cd38e33cdc13c25c270c355702e8c4c842b105a
2019-11-11 12:00:18 -05:00
Stan Iliev
aaa9e834d4 Decouple SurfaceTexture from HWUI
Remove all Skia and HWUI types from SurfaceTexture
implementation.
Move SurfaceTexture to libgui (ag/9578265).
Define private C++ API for SurfaceTexture, which is consumed
by DeferredLayerUpdater.
Move AutoBackendTextureRelease/Skia code from SurfaceTexture
to HWUI.

Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 136263580
Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213
2019-11-08 15:37:17 +00:00
Alec Mouri
05955610a0 Merge "[HWUI] Get DeviceInfo through stable ABI" 2019-11-07 17:15:47 +00:00
Nick Desaulniers
b451d87468 [frameworks][base][hwui] re-fix -Wimplicit-int-float-conversion
A new instance snuck in since I haven't completed the platform toolchain
upgrade yet. There was imprecision in this call; accept it by making the
implicit cast explicit.

Bug: 139945549
Test: mm
Change-Id: Id704d9741b480eba4cf3955e70119d935776faf6
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-04 17:18:51 -08:00
TreeHugger Robot
f86ad8f6ea Merge "Fix wrong surfaceRequiresRedraw check" 2019-11-04 18:56:52 +00:00
Colin Cross
192f73507b Merge "Fix fallthrough warning" am: e1813e522f am: 937e4af019
am: 19370ab6b1

Change-Id: Ia4e1ddc741aa25f25bbbd18a425e7df64f56ba96
2019-10-31 16:06:40 -07:00
John Reck
4145919ef9 Fix wrong surfaceRequiresRedraw check
We only need to redraw if the size /changed/ not
if it was the same. Also fix damageId to not use
frameNumber as repeated redraws of the same frame
would toggle.

Bug: 143711430
Test: systrace
Change-Id: I8ac4629c9ff4fd51de33d1be7aa46ccc995ba342
2019-10-31 15:04:58 -07:00
Colin Cross
f4e74b8fa0 Fix fallthrough warning
Fix a single fallthrough warning and re-enable -Wimplicit-fallthrough.

Test: m libhwui
Change-Id: I850f53f717417f70c9d0416176d03fd64473d1ba
2019-10-31 13:47:42 -07:00
TreeHugger Robot
59e43a98f8 Merge "Remove a dead option" 2019-10-30 00:32:02 +00:00
TreeHugger Robot
b051671aa3 Merge "[HWUI] Use ANativeWindow_get{Height, Width}" 2019-10-29 09:39:18 +00:00
John Reck
2afc3b0a00 Remove a dead option
Test: builds & text still works
Change-Id: Ia9c678f258834d7cc5e65027db8be4c37fb6b4db
2019-10-28 15:51:25 -07:00
Alec Mouri
da819e47f1 [HWUI] Use ANativeWindow_get{Height, Width}
gui/Surface will eventually be removed since HWUI needs to depend on a
stable ABI, so use the NDK methods for querying width and height that
operates on ANativeWindow instead.

Bug: 137012798
Test: builds
Change-Id: I1309e31992190e7b44c6ea83f962f372b6b0afcf
2019-10-25 16:18:16 -07:00
John Reck
5a23400610 Merge "Delete VectorDrawableAtlas" 2019-10-25 22:28:40 +00:00
Alec Mouri
22d753f74d [HWUI] Get DeviceInfo through stable ABI
This also removes the dependency on ui/DeviceInfo other than in test
code.

Bug: 136263392
Bug: 136263238
Test: builds, boots
Change-Id: I6a4687e981359f0e6beb83be8a5501ed7fd16f15
2019-10-25 13:30:42 -07:00
TreeHugger Robot
d7bcfca48e Merge "Fix buffer damage for quad-buffer" 2019-10-22 22:45:45 +00:00
John Reck
ca718a06d5 Fix buffer damage for quad-buffer
Test: none
Change-Id: I4789d84945e381d67e96ef37554a161dbd0ab16c
2019-10-21 10:15:02 -07:00
Ryan Mitchell
8a891d86ab Allow for RRO internal referencing
This change allows RROs to reference their own internal resources as
expected.

Overlays are loaded as shared libraries so they can have their own
resource id space that does not conflict with the resource id space of
the target or other overlays.

References to overlay resources that override target resources now
appear as references to the target resources.

Overlay values that are inlined into the xml file specified using
android:overlayResources are now able to be used at runtime.

See go/rro-references for more information.

Bug: 135943783
Test: idmap2_tests
Test: libandroidfw_tests
Change-Id: Ie349c56d7fd3f7d94b7d595ed6d01dc6b59b6178
2019-10-17 13:09:33 -07:00
Ryan Mitchell
e753ffef54 Idmap format changes for bidirectional lookup
This change modifies the idmap file format to allow for target resources
to map to arbitrary type/value combinations and to allow overlay
resources to be mapped back to target resource ids so references to
overlay resources can appear as references to target resources at
runtime.

The mappings of target resources to overlay resources and vice-versa are
both encoded as sparse arrays. Instead of looking up a resource by
indexing into an array that maps to the overlay resource id, the runtime
will binary search over the sparse array to find the type and value that
overlays the target resource.

Bug: 135943783
Test: idmap2_tests
Change-Id: I5d5344cdb7fe35f4f2e8d6781016299dea5d1e20
2019-10-17 11:37:24 -07:00
Nick Desaulniers
32be5c8073 Merge "[frameworks][base][hwui] fix -Wimplicit-int-float-conversion" am: f7cf0dfa55 am: 0b6b756f3d am: d171f486f6
am: 580763aabe

Change-Id: I3b062d044ef7a88498edeaf5c1fcd0f3387d2943
2019-10-15 22:21:44 -07:00
Nick Desaulniers
0b6b756f3d Merge "[frameworks][base][hwui] fix -Wimplicit-int-float-conversion"
am: f7cf0dfa55

Change-Id: I8e7398797b53eab6efdebf7b5e83f6573ee5f83c
2019-10-15 21:30:43 -07:00
Treehugger Robot
f7cf0dfa55 Merge "[frameworks][base][hwui] fix -Wimplicit-int-float-conversion" 2019-10-16 03:48:23 +00:00
Yi Kong
8a395e7a37 Merge "[hwui] Remove -Wno-missing-braces" am: d6e30691e5 am: 6fecf93fea am: cfa361edca
am: 853445d1a9

Change-Id: I9b9d02dee4da411e0c6f2138ec341384f8e7c174
2019-10-15 11:42:18 -07:00
Yi Kong
6fecf93fea Merge "[hwui] Remove -Wno-missing-braces"
am: d6e30691e5

Change-Id: I63d4d6b012bc5408758040f91702d46f811d99fa
2019-10-14 18:35:11 -07:00
Yi Kong
b69fd6724c Merge "Disable the new pass manager for libhwui" am: 3268a5ec1a am: 9a283f69a0 am: 9c43003e57
am: 3917055fc1

Change-Id: Iffd9d3d3861f9ad0b23cd9a4ddf726c9a44b2c1f
2019-10-14 17:09:58 -07:00
Yi Kong
9a283f69a0 Merge "Disable the new pass manager for libhwui"
am: 3268a5ec1a

Change-Id: I164d3eacf5f955568724557c571d0588e7f100a4
2019-10-14 16:25:12 -07:00
Pirama Arumuga Nainar
c1610d3c95 [hwui] Remove -Wno-missing-braces
The Clang bug that caused this silencing has been fixed for a while.

Test: mmma frameworks/base/libs/hwui
Change-Id: Ia03f7c223f95a51fbda70dbbbabf4821eaef74ca
2019-10-14 10:52:54 -07:00
Yi Kong
304d4bd65d Disable the new pass manager for libhwui
Clang is producing non-deterministic result when the new pass manager is
enabled.  Turn it off as a temporary workaround.

Test: presubmit
Bug: 142372146
Change-Id: Ie21d97c0fe6770b0ae9ec103133b940b1eb8a220
2019-10-14 10:52:37 -07:00
Winson Chiu
8e4f087cc1 Merge "Add ResourceLoader API with .apk and .arsc support" 2019-10-11 18:05:00 +00:00
Winson
9947f1e4fa Add ResourceLoader API with .apk and .arsc support
ResourceLoaders allow inserting another .apk/.arsc into AssetManager's
resource resolution search. The effect is similar to overlays,
where a entry of >= config later in the path list will return that
ApkAsset's resource value instead.

Because loading from an .arsc is supported, which doesn't contain
any actual files, ResourceLoader exposes loadDrawable and
loadXmlResourceParser to allow an application load those files from
anywhere or create them in code.

The data being loaded is either pushed into an .apk or .arsc that
mocks itself as the package being "overlaid" and is passed in
through ResourcesProvider, an interface with static methods that
supports loading from a readable path on disk or a FileDescriptor.

The APIs are accessed through a Context's getResources(), which
has been changed to be unique per "Context-scope", which is usually
the lifetime of the Java object. The exception is that Activities
who get their Resources object persisted across recreations
maintain that logic for persisting ResourceLoaders.

Bug: 135270223

Test: atest FrameworksResourceLoaderTests

Change-Id: I6929f0828629ad39a21fa155e7fec73bd75eec7d
2019-10-10 15:41:03 -07:00
Ryan Mitchell
d61d44da96 Merge changes I1740dcdc,I12f965b5
* changes:
  Parse <overlay> and abstract resource mapping
  Improve idmap2 xml parsing
2019-10-10 22:36:44 +00:00
Nick Desaulniers
19ae5f9ac9 [frameworks][base][hwui] fix -Wimplicit-int-float-conversion
DIRTY_MAX cannot be represented precisely in an IEEE 754 single
precision float.  Calls to DamageAccumulator::dirty() that pass
DIRTY_MAX thus result in an implicit cast that results in imprecision.
Add one to the DIRTY_MAX constant so that its value can be precisely
representing in a single precision float.

Alternatively, we can accept the imprecision via explicit casts in
multiple call sites.

Bug: 139945549
Test: mm
Change-Id: I38b2942f976ad05af2d0e45d1a9fe4214e759a02
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-10 20:22:44 +00:00
John Reck
183e1380ce Improve dumping of display list memory usage
The first step of improving is measuring. So measure better.

Bug: 138856108
Test: dump
Change-Id: I076b904a1f0dfb209622c76bcb8778a10cd2b7db
2019-10-09 13:42:43 -07:00
TreeHugger Robot
d4bd5714f9 Merge "Revert "Drop all caches in UI_HIDDEN"" 2019-10-09 01:01:35 +00:00