34 Commits

Author SHA1 Message Date
John Reck
af3e763358 Merge "Disable LTO on -eng"
am: 1918b39942

Change-Id: I925182b722d7bf6b1bb63c298a8ec9e345f0c4ac
2018-07-11 14:48:50 -07:00
John Reck
2729418128 Disable LTO on -eng
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
2018-07-11 18:24:58 +00:00
Derek Sollenberger
0fba15b2ba Bind correct FBO when drawing a WebView into a layer.
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
2018-06-01 01:08:15 +00:00
Yao Chen
49954cd681 Add socket listener to statsd. And remove Davey atom.
+ 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
2018-04-20 17:41:25 -07:00
Kweku Adams
1856a4cfcc Adding privacy tags to graphicsstats proto.
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
2018-04-12 14:23:15 -07:00
Derek Sollenberger
0057db22fe Print detailed memory usage of Skia for dumpsys gfxinfo
Bug: 74435803
Test: adb shell dumpsys gfxinfo [package_name]
Change-Id: I1f2bcab500fb47c5e0b50c7459d4a876b063916b
2018-04-02 15:37:06 -04:00
Pirama Arumuga Nainar
b7913e1f8a Revert "Disable LTO temporarily for hwui"
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
2018-03-09 00:04:43 +00:00
Pirama Arumuga Nainar
7184e28b3a Disable LTO temporarily for hwui
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
2018-03-07 23:24:02 -08:00
Zhizhou Yang
f30f112da0 Enable ThinLTO for hwui
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
2018-03-01 11:21:30 -08:00
Tej Singh
bb8554afda Atom: DaveyOccurred
Atom for davey occurred

Test: cts test accompanying && statsd unit tests && hwui unit tests
Change-Id: I715ac213b09ef2b3ef1de75bc456a5edf7e0a244
2018-02-01 16:34:55 -08:00
Leon Scroggins III
5b7f426ff0 Use a separate thread to decode AnimatedImageDrawable
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
2018-01-29 21:08:18 -05:00
Derek Sollenberger
2d14213849 Initial implmentation of AnimatedImageDrawables on the RenderThread.
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
2018-01-24 13:11:39 +00:00
Zhizhou Yang
58e1b782be Turn on PGO for hwui
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
2017-12-06 16:59:06 -08:00
Pirama Arumuga Nainar
bc1e17799d Add a phony target containing benchmarks for PGO
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
2017-11-17 12:31:56 -08:00
Pirama Arumuga Nainar
0dfd4be9ae Apply PGO for all modules in hwui
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
2017-11-17 10:31:48 -08:00
Stan Iliev
d495f43992 Implement SkSL cache
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
2017-11-08 18:55:41 +00:00
John Reck
f8441e6552 Switch to a fancy new queue
Test: unit tests & benchmarks pass/faster

Change-Id: I9521432172d6dd6039c5280b1265479a36a86247
2017-10-27 13:39:55 -07:00
Zhizhou Yang
ded6035da8 Turn off PGO temporarily
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
2017-10-17 13:37:00 -07:00
Zhizhou Yang
17371ecffc Enable PGO for hwui
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
2017-10-13 11:42:13 -07:00
Derek Sollenberger
71b36912e0 Merge "Reduce overhead by combining libskia and libhwui into a single library." 2017-09-25 15:45:34 +00:00
Derek Sollenberger
d938e5a2e2 Reduce overhead by combining libskia and libhwui into a single library.
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
2017-07-24 09:42:07 -04:00
Stan Iliev
3310fb1b24 Cache VectorDrawables in an atlas
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
2017-07-18 19:00:15 -04:00
Leon Scroggins III
f51a80d2b0 Remove more references to kIndex_8
Test: Covered by existing tests. No actual change in behavior, since
kIndex_8 is not being used anyway.

Bug: 62483967

Change-Id: I317e3a814dbd102925fe412d2e19111b0af3af38
2017-07-12 11:27:19 -04:00
John Reck
34781b2530 Move frame history into jank tracker
Test: hwui_unit_tests & manual
Change-Id: If761947652750640268217cd8cd97c8382441b44
2017-07-05 16:48:09 -07:00
John Reck
7075c79209 Split out jank data from policy
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
2017-07-05 14:04:51 -07:00
TreeHugger Robot
12741cec2d Merge "Implement CacheManager for the Skia pipelines." 2017-06-06 20:37:08 +00:00
Derek Sollenberger
f9e45d1d81 Implement CacheManager for the Skia pipelines.
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
2017-06-06 14:19:37 -04:00
Chris Craik
d17b63cbfc Temporarily enable HWUI opengl validation
Bug: 38416992
Test: full make, device boots
Change-Id: Ib4c058ec24a8cb46b18964635d51e266d7dcd196
2017-06-01 14:48:30 -07:00
Narayan Kamath
d6b42a9f7a Revert "Temporarily enable HWUI opengl validation"
This reverts commit 39aa790f744d504dfcafbf5e9224b7d9906067e4.

Seems to have broken all builds on master. Unclear why the presubmit
succeeded.

Test: make

Change-Id: I1ff8472495b5aafe6c1c89c1c8385d94ae584685
2017-06-01 08:57:58 +00:00
Chris Craik
39aa790f74 Temporarily enable HWUI opengl validation
Bug: 38416992
Test: device boots

Change-Id: I20b7e3546f29c0a0d3e41a7cdafbcc5f4ad387e2
2017-05-31 16:06:02 -07:00
John Reck
915883b9f0 Switch to protobuf lite
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
2017-05-12 10:44:46 -07:00
Seigo Nonaka
1f9c461e6a Fix double bolding
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
2017-05-08 11:11:06 -07:00
Colin Cross
3f8fd40f28 Convert libandroid and libandroid_runtime to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
2017-05-04 13:00:21 -07:00
Colin Cross
f629810118 Convert libhwui to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: Ifebdb3797498d49f2bebe5fc728e6d6d8def71cb
2017-05-03 16:40:57 -07:00