Commit Graph

10686 Commits

Author SHA1 Message Date
Ruchir Rastogi
4e65e38795 Delete StatsLogEventWrapper
Since all pullers now use StatsEvent instead of StatsLogEventWrapper,
this class can be deleted.

Test: m -j
Test: m -j statsd_test
Bug: 146578681
Change-Id: I63013768ee13af0235f8cd857ca3fc16d2fd877f
2020-01-24 12:07:25 -08:00
TreeHugger Robot
069dc4277e Merge "Make bitmap compression retain the ColorSpace" 2020-01-24 14:59:58 +00:00
Leon Scroggins III
949c6006cb Make bitmap compression retain the ColorSpace
Bug: 147877556
Test: I72b5f28903a67445bc205cdad8848384ad675b31

In Bitmap#compress and AndroidBitmap_compress, remove the conversion
from F16 to 8888 P3. This was originally done because F16 forced a
particular ColorSpace, and we wanted to use a wider gamut than SRGB.
Now that F16 can be any RGB ColorSpace, encode it with the ColorSpace
that it already has. Skip the conversion to 8888, which is unnecessary.
The encoders can already convert from F16.

Remove Bitmap::CompressResult. Now that compress does not allocate a
Bitmap, there is no reason to return ALLOCATION_FAILED.

Change-Id: I8190664398e762daf57092d919f382a56267dd07
2020-01-23 16:26:47 -05:00
TreeHugger Robot
414e1576d6 Merge "Move setDisplayViewport to InputReader." 2020-01-23 20:19:08 +00:00
TreeHugger Robot
76d97548c4 Merge "extend recordingcanvas overrides for mat4" 2020-01-23 13:38:12 +00:00
Mike Reed
a4973d8436 extend recordingcanvas overrides for mat4
Note: SkCanvas now tracks a real 4x4, so android could consider using it

Test: make

Change-Id: I6e201f2feec4fb4663f5d3e62fe0ffef5ef9a33f
2020-01-22 20:06:26 +00:00
Winson Chung
8820327bea Merge "Move WindowManager Shell from packages/ to libs/" 2020-01-22 20:00:05 +00:00
Leon Scroggins
569229f0bb Merge "Implement AImageDecoder dataspace methods" 2020-01-22 19:39:06 +00:00
Leon Scroggins
a75d46afd0 Merge "Move ABitmap_getDataSpace into hwui to share with AImageDecoder" 2020-01-22 13:21:40 +00:00
Andrii Kulian
db4f5466b9 Move WindowManager Shell from packages/ to libs/
Test: Build
Change-Id: I03833b0aff5836cc00b8371907f9059aa1acc5b1
2020-01-21 11:48:19 -08:00
Leon Scroggins III
e5ace3f9cb Implement AImageDecoder dataspace methods
Bug: 135133301
Test: Iffe659e50078139188c3325545624640ae177cc2

Implement AImageDecoderHeaderInfo_getDataSpace, which reports the
default ADataSpace to decode to. It may report ADATASPACE_UNKNOWN, which
means that we've mostly left the colors in their original color profile.
This matches android.graphics.ImageDecoder/BitmapFactory, which would
use a ColorSpace named "Unknown". (It will standardize on DISPLAY_P3 for
some profiles, which again matches the Java classes.)

Implement AImageDecoder_setDataSpace, which allows specifying the
ADataSpace to decode to. It only supports explicit ADataSpaces.

Change-Id: Iba2f9e09531c23fae83ebe13cb9d18394ee3cd59
2020-01-21 13:27:58 -05:00
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
Leon Scroggins III
d256790d13 Move ABitmap_getDataSpace into hwui to share with AImageDecoder
Bug: 135133301
Test: android.graphics.cts.BitmapTest#testNdkDataSpace

Change-Id: Ib54523a16a3ac9149a6b072489d97a39f8cc1564
2020-01-19 11:52:49 -05: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
Garfield Tan
68ede07175 Move setDisplayViewport to InputReader.
InputReader is responsible to associate device and display so it makes
sense to allow it set display viewport for pointer controller.

Bug: 146385350
Test: Cursor can be associated with external freeform displays as
expected.

Change-Id: I00d664dd180f1e693b1900582feea8f7ff02f93c
2020-01-09 12:13:35 -08: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