Speeds up incremental compile of one cpp file change
from over a minute to around 15 seconds
Bug: 111277863
Test: touch a .cpp file in hwui & mmm
Change-Id: I946ecad411a7a59f87ed9e1eeb146d6f57bd038a
The WebView was unable to draw into either a standard clipped
layer or the "fading edges" unclipped layer. This CL and its
companion test cases ensure that both work with simple and
complex clips.
Bug: 79619253
Bug: 80443556
Bug: 80477645
Test: atest CtsUiRenderingTestCases:.LayerTests
Merged-In: I0e16b724f74415a61cc2a841ccf4a491f293ac94
Change-Id: I4900222975fc841b11828916878fb0ea6d87dcda
+ The socket listener is behind a flag. It's disabled until we get sepolicy changes in.
+ Data parsing code is from logd, because we use the same format.
+ Removed Davey from JankTracker because it violates our new sepolicy
Test: manually
Bug: 78239479
Change-Id: Ib17729fbc362cdb13385f780e2d636a95adf9bc3
Creating a copy of the graphicsstats proto so that one can be tagged
with privacy annotations and the other can be used internally while
still using the protobuf-cpp-lite library.
Bug: 72570104
Test: flash device and check incident output
Merged-In: I2d72e7bd17689c1401a16d5a13956e6528ddb525
Change-Id: I0a46ee6cc463b133925be1cf8dee8cf3d107930c
Bug: http://b/62839002
Bug: http://b/74395273
Turn LTO back on for hwui. The reason for the build breaks were stale profile files in ccache. We'll hold off on updating profile files until this can be fixed. LTO can be turned back on in the mean time.
This reverts commit 7184e28b3ae349ae2e64693ac6d4c72a33ec3a61.
Change-Id: I051c39a44be6a85682393e7d6e78f49b30bb85e1
Bug: http://b/62839002
LTO does not seem to interact well with PGO profile-file updates and
incremental builds in the build servers.
Test: build
Change-Id: I42175b2376b374d00ec169d4fe8d84cd938b21e5
ThinLTO will benefit hwui on both performance and code size.
Now that hwui is with PGO, ThinLTO provides 3.8% performance improvement
on top of it (tested using hwui benchmarks on marlin device).
Enabling ThinLTO also decreases current code size of libhwui.so by 3.2%.
To be mentioned, Thinlto property in bp file will go through all static
libraries that hwui depends on (such as libskia) and enable Thinlto for
them when building hwui.
Test: Build and run benchmarks with ThinLTO enabled.
Bug: http://b/62839002
Change-Id: I89466d50c3715f6e7b0518ff10240bf8a5e9714c
Bug: 63908092
Test: Manual: Ie18811ba29a1db163aca08472b04ae185e9344f0
Depends on https://skia-review.googlesource.com/#/c/skia/+/101544. That
change removes the Skia class's time checks, and leaving it up to the
client to keep track of the time. In this case, the client wants to keep
track of the time because it only wants to update while it is being
drawn. If it goes off screen (for example), it will just resume where it
left off when it returns on screen. This allows for smooth animations.
If an AnimatedImageDrawable is being drawn to a SkiaRecordingCanvas,
decode on the new (lazily-created) AnimatedImageThread.
When running, always decode one frame ahead on the AnimatedImageThread
so that it will be ready when it is time to display.
During prepareTree, update the time and check whether there is a new
frame ready to draw or the next frame needs to be decoded. In either
case, return true. The next frame to be decoded will be triggered by
onDraw.
Change-Id: If447976e9df417060a950f658dbca9cf7980dd02
The current implementation schedules the next frame of the images
to be decoded after the current frame completes but potentially
schedules tasks that will result in a no-op execution if a new
frame is not yet needed.
Test: HwAccelerationTest
Change-Id: I0510cb5a1b801abd651327e924deb586af0306d6
This patch is to turn on PGO for hwui. PGO for hwui was turned off for
now because skia, a very important dependency of hwui, was not compiled
with PGO at that time. This patch will be committed along with the patch
to turn on PGO for skia, so that we could get the best performance
improvement.
According to our test, turning on PGO for hwui only introduces an
performance improvement of 5.5%, while with skia PGO turned on, the
improvement increases to 7.6%, both on hwui benchmarks.
Bug: http://b/63768402
Test: None
Change-Id: I17af2cce8e7991aeb89d8bd14ef2e40e6d1049b6
Bug: http://b/69281673
Bug: http://b/63768402
Add a 'pgo-benchmarks-hwui' target that builds hwuimicro and hwuimacro.
This lets us set an automated build/image that includes an instrumented
hwuimicro and hwuimacro for collecting profiles.
Test: Run 'make PRODUCT-taimen-userdebug ANDROID_PGO_INSTRUMENT=hwui
pgo-targets-hwui'
and verify that an instrumented hwuimacro and hwuimicro gets
built.
Change-Id: I51308c1971e96f5c798b3303972b2f5e09103321
Bug: http://b/65598278
Since hwui source files get statically linked into hwuimicro and
hwuimacro, we need to enable PGO for them (to instrument and collect
profiles). For consistency, apply PGO to all hwui modules (including
the unit tests) so we test the actual build configuration for libhwui.
For now, we don't use any profile so this CL affects the build only when
instrumentation is turned on using 'ANDROID_PGO_INSTRUMENT=hwui'.
Test: Build with ANDROID_PGO_INSTRUMENT=hwui, run hwuimacro and
hwuimicro and verify profile generation
Change-Id: I9d35953d544e0ccc180eb164ff53466239194c0f
Implement SkSL cache by reusing code and logic from egl_cache_t.
Test: Improves startup times for gmail by 15ms and 10ms for calc app.
Bug: 66740665
Change-Id: I9ba479c649ba97a2c29a48d40579ba001264c957
Bug: http://b/67862169
Turn off PGO for hwui since it caused a performance regression in
tesetBitmapDrawPerf.
Test: Built successfully and tested the performance with benchmarks.
Change-Id: I7be1ff919cc03eb72e2464867a417cc3dad7a260
This patch is trying to apply PGO for hwui. According to some research
on PGO before, we got a 5% to 10% performance improvement with PGO on
hwui and we hope to enable it.
The patch specified a hwui.profdata file, which locates in internal
google_data/pgo_profile directory, to work as the profile to feed PGO.
This profdata can be re-collected through the PGO collecting script in
the benchmark directory, and it was based on hwuimicro/hwuimacro
benchmark for now.
PGO can be turned of by setting ANDROID_PGO_NO_PROFILE_USE environment
variable.
Test: Build hwui successfully and verified the performance improvement
on device through benchmark.
Bug: http://b/63768402
Change-Id: Ib63e5504be34bdfe49f6bc2c52964c30c81f1416
This is a multiproject change as we need to both the libraries
themselves as well as those that had dependencies on libskia.so
Bug: 31971097
Test: compile only
Change-Id: Ie6ff1f4682d03289205f4d6048cde9f95c61a90f
Optimize VectorDrawables for Skia pipeline: draw small VectorDrawables
in a GPU atlas instead of seprate offscreen buffers.
This implementation is using CacheManger and allows for the atlas to
be released if there is a memory pressure.
Test: A new unit test for VectorDrawableAtlas is passing. Systrace shows
0.5ms faster DrawFrame for fling in Settings app main screen.
Change-Id: Ide3884eefae777e1547f1dfdb67b807185839fb4
Test: Covered by existing tests. No actual change in behavior, since
kIndex_8 is not being used anyway.
Bug: 62483967
Change-Id: I317e3a814dbd102925fe412d2e19111b0af3af38
Move ProfileData out to its own file with helper
accessors. This keeps policy (what is/isn't jank)
outside of the data storage.
Also use lambdas to iterate over the histogram
to make it nicer for dumping & proto-ifying.
Test: hwui_unit_tests pass & jank data still dumps
Change-Id: I88488369ec77590a2867f51128e65bb786aa34e6
The core of the implementation is complete and provides heuristic
cache sizing based on the size of the surface being used. This CL
will also be used to add the following features in the future...
1) Support Vulkan pipeline reporting on the size of the surface.
2) Complete the VectorDrawableAtlas stub code
3) Automatic purging of stale resources for low memory devices.
Test: hwui_unit_tests (new test added) and CtsUiRendering
Bug: 62260637
Change-Id: Ib85159cca28b646fe249f2190b07f1b7e0f50d8f
This reverts commit 39aa790f744d504dfcafbf5e9224b7d9906067e4.
Seems to have broken all builds on master. Unclear why the presubmit
succeeded.
Test: make
Change-Id: I1ff8472495b5aafe6c1c89c1c8385d94ae584685
Fixes: 36272398
Protobuf lite isn't just smaller, it also doesn't
have the problematic DescriptorPool at all. So no
need to switch this to a shared library.
Test: hwui_unit_test passes and doesn't crash. CTS incident tests pass
as well
Change-Id: I2693ba2c47af89a5c561c4f63cc7e1f509ebbbec
resolveStyle increases minikinStyle's weight value based on Skia's style
value. Since we compute Skia's style based on given weight value, we
should not add extra bold weight to minikinStyle.
This CL also fixes misunderstanding of base weight.
The base weight is only used for computing weight relative to the
weighted alias. Thus, base weight should not be updated except for
createWeightAlias method.
To be clear, this CL changes the function names but keeps the same
semantics as before.
Test: adb shell /data/nativetest/hwui_unit_tests/hwui_unit_tests
Test: am instrument -w -e class android.graphics.cts.TypefaceTest\
android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Bug: 37880319
Change-Id: Ied73189b11792fb062da46f45afd2db664e6ecb4