Commit Graph

10673 Commits

Author SHA1 Message Date
TreeHugger Robot
712d610d05 Merge "Refactor TextureLayer JNI to use only APEX APIs" 2020-01-21 18:18:21 +00:00
Nathaniel Nifong
1beddee406 Merge "Do not clip draw commands during recording of SKP files" 2020-01-21 16:43:56 +00:00
Nathaniel Nifong
89a5dc514e Do not clip draw commands during recording of SKP files
Test: Confirmed drawing is unaffected on pixel 3, confirmed all commands are recorded.

Change-Id: Ib543730c321f5082d9a2331241873f9b2e8289c8
Bug: skia:9758
2020-01-17 20:53:31 +00:00
TreeHugger Robot
afceb8c310 Merge "Rename HWUI ATRACE memory counters" 2020-01-17 20:11:25 +00:00
Stan Iliev
5af5d3077f Refactor TextureLayer JNI to use only APEX APIs
Move ASurfaceTexture JNI implementation from libandroid to
libnativedisplay.
TextureLayer uses ASurfaceTexture_fromSurfaceTexture from
libnativedisplay instead of libandroid_runtime code.
libgui is no longer leaked through surface_texture_platform.h.
DeferredLayerUpdater uses ASurfaceTexture_release instead of
private ASurfaceTexture dtor.

Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 147060713
Exempt-From-Owner-Approval: Changed only a header path in android_hardware_camera2_legacy_LegacyCameraDevice.cpp
Change-Id: I9720d9c383f8120f9db116fd2b74fc241af84396
2020-01-17 20:09:19 +00:00
TreeHugger Robot
c3d20c1935 Merge "Implement native compress API" 2020-01-17 19:23:46 +00:00
TreeHugger Robot
bbef27bc28 Merge "Replace setAlphaFlags with setUnpremultipliedRequired" 2020-01-17 19:10:20 +00:00
Stan Iliev
283a9289e9 Rename HWUI ATRACE memory counters
Rename HWUI ATRACE counters from "Graphics CPU Memory",
"Graphics Texture Memory" and "GPU Memory" to "HWUI CPU Memory",
"HWUI Texture Memory" and "HWUI GPU Memory". New names apply
for purgeable memory, but with "Purgeable " prefix.
Add a new counter "HWUI All Memory", which is a sum of the other 3.
New counter simplifies perfetto query needed to detect a
memory regression.

Bug: 147833967
Test: Ran systrace
Change-Id: I39e0c6e1dbd21b67f457cc58f3fa94eb24d64d56
2020-01-17 18:08:47 +00:00
Leon Scroggins III
9010e8ba91 Implement native compress API
Bug: 135133301
Test: Ifbcb41388a48afc64bb22623bb7e981b288b2457

Refactor the bulk of Bitmap_compress into hwui/Bitmap::compress, so that
it can be shared by the new API. Update its enum to match the proper
style. Also make the enum a class so it does not need to have a special
return value for a bad parameter, which is now handled by the caller.

Add ABitmap_compress, which implements the new API by calling
hwui/Bitmap::compress.

Change-Id: Ia8ba4c17b517a05b664c6e317e235836473fd7f6
2020-01-16 22:21:10 +00:00
Leon Scroggins
6bb457b3f1 Merge "Support more dataspaces in DataSpaceToColorSpace" 2020-01-16 21:37:23 +00:00
Leon Scroggins III
700629d8c0 Support more dataspaces in DataSpaceToColorSpace
Bug: 135133301
Test: ?

Create an SkColorSpace for HAL_DATASPACE_TRANSFER_ST2084 and
HAL_DATASPACE_TRANSFER_SMPTE_170M. This allows converting
ADATASPACE_BT709, ADATASPACE_BT2020, and ADATASPACE_BT709 into
SkColorSpaces. In addition, treat HAL_DATASPACE_DCI_P3 (aka
HAL_DATASPACE_DCI_P3) specially, because its gamut does not match
SkNamedGamut::kSRGB.

This will allow Ia8ba4c17b517a05b664c6e317e235836473fd7f6 to use
DataSpaceToColorSpace, rather than its own, slightly different version.

Change-Id: I24fffd79c2bf251c28c2d0b8c3d2889dbffa772d
2020-01-16 14:21:49 -05:00
Leon Scroggins III
1ade46d272 Replace setAlphaFlags with setUnpremultipliedRequired
Bug: 135133301
Test: I48e49ee08ab1954eddf62ecae87942aeb128c10d

As described in I3381582e27894e1072db9b8635f3762b801f5d69, this is a
more sensible API.

In addition, remove unused methods on ImageDecoder.

Lastly, update AImageDecoder methods in the map to document which API
level they were introduced in.

Change-Id: I1aff544e8d6932b9ed0931a00da66a0aba6cd536
2020-01-16 12:17:56 -05:00
Automerger Merge Worker
ba61f7022c Merge "Revert "Disable the new pass manager for libhwui"" am: 8c794f129c am: 98f3b82951 am: 758e8c8a5c
Change-Id: I55d20dc86c768feecbfcb14bdc666de53cd0173a
2020-01-16 01:33:24 +00:00
Automerger Merge Worker
758e8c8a5c Merge "Revert "Disable the new pass manager for libhwui"" am: 8c794f129c am: 98f3b82951
Change-Id: I3228fa7d8d682769cf0ed9697a7389cb72cfe2d9
2020-01-16 01:22:35 +00:00
Yi Kong
2d969e4dfd Revert "Disable the new pass manager for libhwui"
This reverts commit 304d4bd65d.

The new pass manager is not the root cause of non-determinism.

Change-Id: I5c0c44bbefd7f3c0442422f5c718e77b1f18f139
2020-01-15 14:46:57 -08:00
Nader Jawad
7ac51f5ec3 Merge "Added support for antialiased canvas clipping" 2020-01-15 21:04:46 +00:00
TreeHugger Robot
1eb06c3e9f Merge "Use ui::Rotation in libgui calls" 2020-01-14 02:22:28 +00:00
Ryan Mitchell
0252b862de Merge changes from topic "shared-lib-tele-res"
* changes:
  Allow for overlaying dynamic shared libraries
  Assign shared libraries stable package ids
2020-01-13 15:15:57 +00:00
Nathaniel Nifong
632393dc75 Merge "Include text draws in looper refactor" 2020-01-13 14:31:14 +00:00
Nader Jawad
e431e31698 Added support for antialiased canvas clipping
Updated native hwui implementation to pass in
optional anti-alias flag to canvas clipping operations.
Made the default behavior to enable canvas clipping

Bug: 69115461
Test: Added test to CtsUiRenderingTestCases
Change-Id: I996f4b56e161cdc9f1ec5eba9c30f94474520af5
2020-01-10 16:41:13 -08:00
Ryan Mitchell
ee4a564d4f Allow for overlaying dynamic shared libraries
Overlays targeting shared libraries should be loaded into the
resources of every target that depends on the shared library.

Static shared libraries are currently not supported because overlays
should override all versions of static shared libraries and there is
not currently support for an overlay targeting multiple APKs.

Also created a test instrumentation and host test suite for testing
overlays and packages on the system image.

Bug: 140790224
Test: atest OverlayRemountedTest
Change-Id: I20a217b6368d6cf92b2b9f46908fd58012933f72
2020-01-10 23:20:19 +00:00
Ryan Mitchell
fe50d739f7 Assign shared libraries stable package ids
When a shared library package is loaded into an AssetManager, the
shared library will be assigned a unique package id. Subsequent
AssetManaagers that load a shared library of the same package name
as the original shared library will use previously assigned package
name. Shared libraries will have stable package ids throughout the
lifetime of application.

Bug: 140790224
Bug: 128496033
Test: libandroidfw_tests
Test: third-party app no longer crashes on open
Test: atest CtsHostsideWebViewTests
Change-Id: Idc0315be21ea00b74d1a918b7083ad655104c008
2020-01-10 23:15:06 +00:00
Nathaniel Nifong
52d3777a26 Include text draws in looper refactor
Test: built for pixel3, confirm shadows on text of launcher icons visible on a background image that shows it well.
Bug:144199311
Change-Id: Ia2e71a1f0982ef94a9b0c0573bf76ead0c0b9b81
2020-01-10 16:13:50 -05:00
Automerger Merge Worker
3b2fb10faa Merge "Allow zero stride" am: 136a4fc875 am: 878963bef6
Change-Id: Ia91d71e779efe51dd0ef07fa5d75cb3062ace9e7
2020-01-10 20:05:56 +00:00
TreeHugger Robot
a2eb784577 Merge "Add memory tracing in HWUI" 2020-01-10 19:45:22 +00:00
TreeHugger Robot
5927ed17a6 Merge "Expose HWUI metrics via statsd" 2020-01-10 17:42:11 +00:00
Stan Iliev
e0fae2356b Add memory tracing in HWUI
Add ATRACE memory counters to track memory usage at the end
of each frame in HWUI.
There are 3 catagories: CPU, GPU and Texture memory.
There are 3 more counters for memory that can be purged.
This CL deletes GpuMemoryTracker class, which implemented
similar function for Android O HWUI renderer.

Test: Collected systrace with gmail and setting.
Test: memory tracing adds ~0.1ms per frame when ATRACE is enabled
Bug: 146580770
Change-Id: Icbcc0478bc426dff578e83726fe7c95df171ed93
2020-01-10 16:14:39 +00:00
Stan Iliev
637ba5e8da Expose HWUI metrics via statsd
Add atom definition for HWUI stats. Implement a C++
statsd puller inside GraphicsStatsService service.
GraphicsStatsService has new private API, which
returns a serialized proto with HWUI stats grouped
by application package and version.

Test: Ran "adb shell cmd stats pull-source 10068"
Test: Ran "statsd_testdrive 10068" and it looks OK
Bug: 142665516
Change-Id: I400c0dbf9e25181d36f9018688b03d86839ac3de
2020-01-10 10:50:25 -05:00
Nathaniel Nifong
b6a5850690 Merge "[MSKP] Record android device clip restriction (dirty region) with each frame." 2020-01-10 15:00:17 +00:00
Anders Frostad Pedersen
d2ba4f36c7 Allow zero stride
For some pixel formats, stride has no meaning.
Take this into account and use buffer width instead.

Bug: 143470518
Change-Id: I728b40803e80c4e534504c5b9db55921bb5e7dbc
Merged-In: I728b40803e80c4e534504c5b9db55921bb5e7dbc
Test: android.graphics.cts.ImageDecoderTest#testConserveMemoryPlusHardware
2020-01-09 23:28:56 +00:00
Nathaniel Nifong
cff969ff51 [MSKP] Record android device clip restriction (dirty region) with each frame.
Test: Confirm recording and normal rendering unaffected on pixel 3
Change-Id: I368a24371317aba26e234649194ae1b05ab0396d
2020-01-09 16:00:43 -05:00
Anders Frostad Pedersen
ffd8cb89e0 Allow zero stride
For some pixel formats, stride has no meaning.
Take this into account and use buffer width instead.

Bug: 143470518
Change-Id: I728b40803e80c4e534504c5b9db55921bb5e7dbc
Test: android.graphics.cts.ImageDecoderTest#testConserveMemoryPlusHardware
2020-01-08 16:44:10 -08:00
TreeHugger Robot
68f7a52419 Merge "[HWUI] use AChoreographer in place of DisplayEventReceiver." 2020-01-08 17:18:49 +00:00
Dominik Laskowski
2a3d9aaebb Use ui::Rotation in libgui calls
Bug: 144601064
Test: Build
Change-Id: I46d6974e67dcae2d42766f08c899c56dddd795e9
2020-01-07 12:28:16 -08:00
Alec Mouri
4a818f189c [HWUI] use AChoreographer in place of DisplayEventReceiver.
Bug: 136262896
Test: builds, boots
Test: scroll through settings app
Test: Toggle between 60/90hz and observe systrace
Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
2019-12-26 10:11:40 -08:00
Alec Mouri
a5a0c962b6 [HWUI] Minor ANativeWindow usage cleanup
* Remove unused header in EglManager
* Rename usage of rotation flags to use the public names.

Bug: 137012798
Test: builds
Change-Id: Ia603e8d74c6ba51f77e352333d1e82816582d827
2019-12-23 08:59:57 -08:00
TreeHugger Robot
5a9109789e Merge "Add tests for layout overlaying" 2019-12-20 21:40:41 +00:00
TreeHugger Robot
548d6dcf77 Merge "idmap2: add debug information to idmap file format" 2019-12-20 14:38:36 +00:00
Automerger Merge Worker
944c611bd7 Merge changes from topic "icu65.1-upgrade" am: ad2026640c am: b1cc7c336b am: 4870a488d4
Change-Id: Ia5343e7e742c844a0b58d3964ec0eac2c3d0b75a
2019-12-20 12:29:42 +00:00
Automerger Merge Worker
4870a488d4 Merge changes from topic "icu65.1-upgrade" am: ad2026640c am: b1cc7c336b
Change-Id: Idb00177817ea267435bd52a08baba8ee66bc8a17
2019-12-20 12:16:45 +00:00
Nikita Iashchenko
ad2026640c Merge changes from topic "icu65.1-upgrade"
* changes:
  Regenerate LocaleDataTables.cpp
  Update API surface for ICU 65.1
2019-12-20 11:14:44 +00:00
Automerger Merge Worker
1d4949230e Merge "Add per-file ownership to libs/androidfw/LocaleDataTables.cpp" am: 073b0dad72 am: 36fac337ad am: b43a2e6740
Change-Id: Ib7ebb261de2d7492f0a5d1bd7faef7210b3ffe12
2019-12-19 21:33:05 +00:00
Automerger Merge Worker
b43a2e6740 Merge "Add per-file ownership to libs/androidfw/LocaleDataTables.cpp" am: 073b0dad72 am: 36fac337ad
Change-Id: Ia0b55f46f5b92ee72ac17f8c1a1c76a75ddc51a5
2019-12-19 21:19:21 +00:00
Nikita Iashchenko
7b085ddae0 Regenerate LocaleDataTables.cpp
LocaleDataTables.cpp was regenerated running the following command
(should be run from frameworks/base):

$ ./tools/localedata/extract_icu_data.py $ANDROID_BUILD_TOP > libs/androidfw/LocaleDataTables.cpp

Test: m droid
Change-Id: If180ff22a74b485cc3cca34a3f9ba98c826a2210
2019-12-19 19:36:50 +00:00
Mårten Kongstad
d7e8a534d0 idmap2: add debug information to idmap file format
Add a new variable length string to the idmap file format. This string will
hold debug information like fulfilled policies and any warnings triggered while
generating the file.

Bump the idmap version to 3.

Adjust the idmap header definition in ResourceType.h to take the new string
into account.

Example debug info:

  $ idmap2 create \
        --target-apk-path frameworks/base/cmds/idmap2/tests/data/target/target.apk \
        --overlay-apk-path frameworks/base/cmds/idmap2/tests/data/overlay/overlay.apk \
        --idmap-path /tmp/a.idmap \
        --policy public \
        --policy oem

  $ idmap2 dump --idmap-path /tmp/a.idmap
  target apk path  : frameworks/base/cmds/idmap2/tests/data/target/target.apk
  overlay apk path : frameworks/base/cmds/idmap2/tests/data/overlay/overlay.apk
  I fulfilled_policies=oem|public enforce_overlayable=true
  W failed to find resource "integer/not_in_target" in target resources
  0x7f010000 -> 0x7f010000 integer/int1
  0x7f02000c -> 0x7f020000 string/str1
  [...]

  $ idmap2 dump --idmap-path /tmp/a.idmap --verbose
  00000000: 504d4449  magic
  00000004: 00000003  version
  00000008: 76a20829  target crc
  0000000c: c054fb26  overlay crc
  00000010: ........  target path: frameworks/base/cmds/idmap2/tests/data/target/target.apk
  00000110: ........  overlay path: frameworks/base/cmds/idmap2/tests/data/overlay/overlay.apk
  00000210: ........  debug info: ...
  00000294:       7f  target package id
  00000295:       7f  overlay package id
  [...]

Also, tell cpplint to accept non-const references as function parameters:
they make more sense as out-parameters than pointers that are assumed to
be non-null.

Also, switch to regular expressions in the RawPrintVisitorTests: no more
manual fixups of the stream offsets! Tell cpplint that the <regex>
header is OK to use.

Bug: 140790707
Test: idmap2_tests
Change-Id: Ib94684a3b4001240321801e21af8e132fbcf6609
2019-12-19 16:51:51 +00:00
Victor Chang
dbd6c5e267 Add per-file ownership to libs/androidfw/LocaleDataTables.cpp
Test: treehugger
Change-Id: I61366a576e75137cef2b6607cd860cfd16c23869
2019-12-19 15:55:52 +00:00
Automerger Merge Worker
cfb045a481 Merge "Regenerate LocaleDataTables.cpp" am: 6658c31b4e am: ccc64a5aef am: ffbeb382a2
Change-Id: Ic6beb9b8a0374663babf41431e5f59ad7c18f7d0
2019-12-17 14:45:33 +00:00
Automerger Merge Worker
ffbeb382a2 Merge "Regenerate LocaleDataTables.cpp" am: 6658c31b4e am: ccc64a5aef
Change-Id: Ie1c1ae3210049bac2d005ed82b05b838ff25d183
2019-12-17 12:24:11 +00:00
Victor Chang
e84c6b50c2 Regenerate LocaleDataTables.cpp
LocaleDataTables.cpp is outdated due to ICU update over the years

Test: ./tools/localedata/extract_icu_data.py $ANDROID_BUILD_TOP
Test: m droid
Change-Id: I21918cc0f50c7347e514dc7b015607e19cffb377
2019-12-16 15:31:09 +00:00
TreeHugger Robot
28834ba4a0 Merge "Separate ImageDecoder JNI from actual work" 2019-12-16 15:29:38 +00:00