Commit Graph

76 Commits

Author SHA1 Message Date
Huihong Luo
35b1dde19b Turn on Webview Overlays
Change the default value of the sysprop to be true.

Bug: 173671170
Test: install webview apks from Vasiliy, make sure surface control is
used.

Change-Id: Idf495a2be3b2bdba4fdaa380a5dbe9fd96158a97
2021-08-16 19:39:21 +00:00
Huihong Luo
eb93107b57 Add a sys prop to control WebView Overlays support
The boolean system property is named as "debug.hwui.webview_overlays_enabled"

Bug: 192267127
Test: change the property value, check presence of Webview Surface
Control

Change-Id: I01e3e26282a5fa79aa504a6e49c5abe1a1c3ea02
2021-06-30 11:47:21 -07:00
Nader Jawad
93d6e248de Add support to toggle different shader
behaviors

Updated HWUI to toggle overscroll stretch
implementation based on whether the
device supports high end graphics
or not

Bug: 187718492
Test: manual
Change-Id: I13a91a8861c07bec8af43268ba22d0f5b7060b4f
2021-05-17 22:42:15 -07:00
John Reck
8088f8e505 Add some more scenes, replace linear with uniform
Test: this
Bug: 187718492
Change-Id: I171b5c15cd18645c2da1cffffa9635f83f8877e6
2021-05-11 20:53:30 -04:00
Nader Jawad
9272f21612 Updated StretchEffect types
Added additional shader stretch effect type
to distinguish between shader based stretches that
are configured in HWUI as well as those that
are configured in both HWUI and SurfaceFlinger

Bug: 184297961
Test: manual
Change-Id: Ie1083cef7cbaf4f877783d67d429af7f5edd0a3c
2021-05-10 16:38:09 -07:00
John Reck
8ed00dc56d Add a linear variant of the stretch effect
Supports SurfaceViews & everything

Test: setprop debug.hwui.stretch_mode 1
Bug: 187718492
Change-Id: I9a222fa4c1a40e80a74cdaf75becb9524cbeed9b
2021-05-10 11:33:20 -07:00
Bo Liu
027b218847 Integrate HWUI with PerformanceHintManager
PerformanceHintManager.Session is in java, so add JNI and a HintSessionWrapper
class in HardwareRenderer. Then pass the two calls as two std::functions
into DrawFrameTask.

Note Session is created per HardwareRenderer, not global (per
RenderThread).

Session includes UI thread, render thread, and the thread pool.
Desired duration is from the intended start duration to the frame
deadline. Add an actual frame start time to compute

Add system properties:
debug.hwui.use_hint_manager to enable PerformanceHintManager
debug.hwui.target_cpu_time_percent to control percentage of frame time
  to be used for target cpu duration.

Test: Manual test that there are no crashes and values make sense.
Bug: 158791282
Change-Id: I83f25433c10daa20033803fb7c4ae45eab34f1d3
2021-04-10 10:21:17 -07:00
Treehugger Robot
83a6070d12 Merge "Use ro.boot.qemu to check if the device is an emulator" am: 62d82e0b33 am: 4ba8fde9ba am: de535f6eb2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625662

Change-Id: Ia613c23fb779697882f9928b15684fb1ff97e9cd
2021-03-17 16:09:12 +00:00
Roman Kiryanov
d6a9f42566 Use ro.boot.qemu to check if the device is an emulator
`ro.kernel.qemu` is deprecated.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Id42d79af90b1fe7e182a96c53c84248e81a7c259
2021-03-10 23:41:31 -08:00
Ady Abraham
7bb70faa04 Remove render ahead from hwui
As HWUI uses vsync id to send buffers to SF, SF applies the right
amount of render ahead by latching the buffers at the configured time.

Test: launch an app and observe systrace
Bug: 178148035
Change-Id: Ifd3e1a2971aad0a085cb35d33e950194046aa634
2021-02-08 18:13:45 +00:00
John Reck
f516e3a36e Fix render_ahead properties
0 and -1 both meant default when 0 should mean
0 and -1 should mean default

Test: manual
Fixes: 179290765
Change-Id: Ia9aa5e3d83757282bfff776e083d6b3d7d29e9c0
2021-02-03 15:30:05 -08:00
Alec Mouri
aa3e498bbc Turn on vk unit tests
* Degrade error when changing the rendering backend from Properties to
no longer be fatal.
* Support using a single graphics queue for the Vulkan backend. Cloud
devices only support a single queue and some Vulkan implementations such
as Swiftshader expose only one queue for simplying their implementation,
so we'll need to support one.

Bug: 175618060
Bug: 162628999
Test: hwui_unit_tests
Test: experiment on Pixel 4 enforcing a single queue (settings app,
maps, sysui)

Change-Id: I495fcabc3c89bd62bbb833998eab4944c6660f6f
2021-01-13 14:35:58 -08:00
John Reck
f42ff762f2 Allow controlling the SDR white point
Test: this
Change-Id: I9ee059afd73ca0850e41072c068c9effe8362382
2020-08-06 17:32:10 -07: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
John Reck
fa93e3cefc Merge "Delete wrap_gles capability" 2019-05-31 20:48:01 +00:00
John Reck
23462d88f5 Delete wrap_gles capability
* Error enforcement doesn't work with libhwui anymore
* We can just do the real, proper thing for unit tests
  & microbenchmarks, which is arguably better anyway
* hwui doesn't have much opengl code left that was wrapped

Fixes: 128629988
Test: hwuiunit, hwuimacro, and hwuimicro all still run
Change-Id: If2568ea0745a67f83e1290860d474c1a01870376
2019-05-29 16:55:06 -07:00
Jerome Gaillard
21e7e2d9b1 Build native android graphics library for desktop
The purpose of this is to be able to use the native graphics code from
the Android platform directly in Android Studio (running on desktop) to
do layout rendering.

This creates a host library that is a subset of libandroid_runtime
including only the JNI files relevant to Android graphics. It also
includes LayoutlibLoader.cpp which is used to load the JNI when using
it as part of layoutlib (the graphics library for Android Studio).

This also creates libhwui-host, a host library that is a subset of
libhwui.

Bug: 117921091
Test: lunch sdk && m libandroid_runtime
Change-Id: I3850020d2d4c13c85e377476bc463d3eb6a01c6d
2019-05-29 15:48:53 +01:00
Jerome Gaillard
a02a12d765 Use libbase API to access system properties in libhwui
Calls to licutils properties API are replaced by calls to libbase
properties API. This will make it easier to make a host target for
libhwui as libbase provides a host implementation for its properties
API.

Bug: 117921091
Test: N/A
Change-Id: I15b4fe1a16d2bc7b271387d8cf3403940b8aae2d
2019-05-28 18:35:29 +01:00
TreeHugger Robot
862a21c977 Merge "Zygote: add a way to preload Vulkan driver" into qt-dev 2019-04-26 05:20:34 +00:00
Yiwei Zhang
4bf3d9eda4 Zygote: add a way to preload Vulkan driver
Since HWUI render pipeline has both GL and Vulkan backends now, we'd
like to preload either GL or Vulkan driver based upon HWUI's choice on
the render backend.

1) Keep using ro.zygote.disable_gl_preload property to disable Vulkan
driver preloading if HWUI's render pipeline uses Vulkan backend.
Properly rename the corresponding APIs for driver preloading.

2) Add a path to preload Vulkan driver based on HWUI's render backend.

Bug: 131249898
Test: build, flash and boot.
Test: verified with set USE_VULKAN=true
Test: verified with setprop debug.hwui.renderer skiagl/skiavk
Change-Id: Ie0bf5d18edcf907c75a25ac3249e2620ec21b63c
2019-04-25 14:29:34 -07:00
John Reck
8915167a88 Fix some force_dark prop behaviors
* Make it persist.hwui.force_dark so the dev option
  survices reboots.

* Remove the internal super-override behavior it applied
  using only the intended ViewRootImpl theme-aware behavior.

Fixes: 127350499
Fixes: 130354206
Test: set dev option, verified nothing went dark. Set dark
theme, verified non-dark apps were force-darked. Rebooted
and verified property still set.

Change-Id: I43adcbc25320669510fb03b162c98cbd14612f55
2019-04-25 10:59:23 -07:00
John Reck
cf185f5b0d Dynamically adjust renderahead
Tracks refresh rate changes and adjusts renderahead
based off of the active refresh rate.

Default is 60hz = 0 render ahead & > 70hz is render ahead 1

Bug: 127822449
Test: systraced stuff

Change-Id: I9849aa065262f21f7602d44cd1761373279dc28d
2019-04-18 14:20:56 -07:00
John Reck
0fa0cbcade Support render-ahead in vulkan
Bug: 127822449
Test: verified render_ahead working with skiavk
Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-12 13:33:25 -07:00
John Reck
4d527226fd Add back render-ahead support
Currently only supported in the EGL path.
Vulkan support Coming Soon

Bug: 127822449
Test: trace of hwuimacro
Change-Id: Iac2b039e11d964aab5b8ca1bdf2a5430b187e2ea
2019-04-04 18:03:35 +00:00
Stan Iliev
b8811aa52f Read product property to set Vulkan as default render pipeline
Bug: 119267168
Test: Booted pixel 3 with Vulkan rendering
Change-Id: Ibc4b2e00d791b1fb333c0e0f5db2b5f084808c24
2018-12-14 22:36:40 +00:00
TreeHugger Robot
85c34682bb Merge "Remove unused HWUI properties." 2018-12-05 16:31:25 +00:00
Derek Sollenberger
fd1c87914a Remove unused HWUI properties.
Test: compile only
Change-Id: Ifef24fe53edcab63af3f9b634849d996dc7960ec
2018-12-04 16:22:58 -05:00
Chris Blume
7b8a808b7d Remove ; from closing namespaces in libs/hwui
When closing a namespace a } is sufficient. It doesn't need to be };
like closing a class or enum.

Within frameworks/base/libs/hwui there is a mix between } and }; when
closing a namespace. There are even mixes between a .h and the
corresponding .cpp files.

In a separate CL I was asked to not close with };. That was a good
comment. I adopted the style from nearby code. This CL cleans up the
nearby code.

Test: I made sure the code still built as expected.
Change-Id: Ieb314a4f48d6e33752463f3be4361fdc9be97482
2018-12-03 16:05:14 -08:00
John Reck
5711911bd3 Enable smart dark
Bug: 116860870
Test: builds, smart dark applies for targetSdk >= Q && night mode is
enabled
Change-Id: I66e4ec4ad3e5c886c5260137fd48e2c92ee59552
2018-10-25 15:25:51 -07:00
John Reck
bb3a358317 Wire-up default force-dark based off of isLightTheme
Bug: 102591313
Test: Compared settings in light & dark UI modes with
force_dark set to true. Observed that force_dark fixes
were not present when UI mode was set to dark, indicating
force_dark was appropriately globally-disabled

Change-Id: I5882829bb5871829fc8fc9911682f52a6ba5f445
2018-09-27 19:38:13 +00:00
John Reck
9ce2bf7e0c Auto-dark mode prototype
Experimental force_dark prototype mode. Enabled
by setting debug.hwui.force_dark to true.

Test: verified nothing changes without prop being set

Change-Id: Ib02f3f1a9c591cab1f312b827451f04c782c2f41
2018-07-09 10:16:25 -07:00
Stan Iliev
02daab6ff2 Add a debug property to enable Skia systrace
Add a "debug.hwui.skia_atrace_enabled" property that allows to
record a systrace with skia drawing ops. App need to be restarted
after setting the new propety to true.

Test: collected skia trace with systemui
Change-Id: I2d1c5911714bfc911894f633ec2df2f6bb953b48
2018-07-02 13:45:53 +00:00
John Reck
1a4a981199 Revert "Add support for render-ahead"
This reverts commit ec100976e0.

Reason for revert: b/77971494
Test: hwuiunit passes

Change-Id: I2e7dc719d2df1dd939b275496c0edc38e458c434
2018-04-18 16:18:17 -07:00
John Reck
1072fffddb Remove Properties::isSkiaPipeline (3/!?)
Test: hwuiunit & CtsUiRenderingTestCases pass
Change-Id: Ie7b336eacdd1b8660e09653c64eb6ea0a7b4a258
2018-04-12 15:21:21 -07:00
John Reck
18f442eb2d Remove RenderPipelineType::OpenGL (1/many)
Just removes the define & all things referencing the define.

Test: hwui_unit passes
Change-Id: I3f98c271e23ef696c40addf260abdc0fb149a70d
2018-04-11 13:39:19 -07:00
John Reck
ec100976e0 Add support for render-ahead
For periods of time during which latency is less important
allow a client to request a deeper render-ahead pipeline.

The latency tradeoff results in less overall visual jank

Test: none, only used by macrobench

Change-Id: I516203b70bdc75b6415fa08bf9c4fb1b598b0102
2018-04-09 10:58:15 -07:00
Jorim Jaggi
767e25ed61 Add ability to change context priority of RT GL context
Test: Use method, observe GPU preemption behavior
Bug: 75985430
Change-Id: Idc08d37f8c95f52c5aab7edf09c0cbff72b8482d
2018-04-06 12:12:07 +00:00
John Reck
564284759f Don't use IPC in isolateProcess
Fixes: 74395652
Test: hwuiunit passes in 'shell stop' state (pseudo-isolated process),
      manually checked non-isolated processes still have working vsync
      via systrace of RT animations demo

Change-Id: I630ea011dc7eb2efa265b25673d3304b3b2510d3
2018-03-16 17:34:02 -07:00
John Reck
6afa009c0c Allow debuggable apps to do skp capture
Change-Id: Ibb56887b28eb8260bf2ca0b38dbe78233e9cfaf4
Fixes: 74086676
Test: verified can still capture an skp
2018-03-01 17:28:35 -08:00
Lingfeng Yang
3a9f223dd1 Don't use shader disk cache on emulator
bug: 71900691

Emulator user might switch renderers, migrate a snapshot to a different
machine with a different shader binary format, etc.

Plus, program binaries don't seem to work so well on some desktop GPUs.

Change-Id: I0c6239acbd556097494aa903d6603c963d3141cb
2018-01-24 12:21:46 -08:00
John Reck
9f51644abf Extreme battery saver: Allow lowering framerate for experiments.
Bug: 68769804
Test: manual
Change-Id: Ic0c95f32c7ba6d86a997997e480e6d8a5f228f25
2017-12-06 13:59:19 -08:00
John Reck
113ddd9ef5 Allow hwuimacro to choose a renderer
Test: this
Change-Id: I500b033257f317f8a3124e8072dc8d39d666b01b
2017-11-09 16:21:21 -08:00
John Reck
1bcacfdcab Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-11-03 10:57:44 -07:00
Stan Iliev
e9d0012bbf Convert skpCaptureEnabled compile time flag into a property
Convert SkiaPipeline::skpCaptureEnabled into a system property.
Add ability to capture drawing in layers. Add ability to capture
animations/sequence of frames. Fix crash when recording a
TextureView.

Test: Ran capture script.
Change-Id: I463eecf6ec90a601a6cc172ad1901bd4bcc86ac8
2017-10-20 17:49:12 -04:00
Derek Sollenberger
04f1f01139 Switch default renderer to back to Skia's OpenGL pipeline once more.
Bug: 63910712
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases, CtsViewTestCases
Change-Id: Idb862a0dece6b13dc7a105f6a47e4e33911ecc4a
2017-09-05 13:12:19 +00:00
John Reck
938e884a1f Avoid setting high contrast in every view draw
Test: high contrast text still works
Change-Id: I6674d1aca8dddf7eb9725a5346aed12ef1dbc195
2017-08-24 16:15:58 -07:00
Derek Sollenberger
60d7841e39 Revert "Switch default renderer to Skia's OpenGL pipeline."
This reverts commit 4bc27b6e64.

Bug: 64487466
Bug: 63910712
Bug: 64683344
Change-Id: Icd4ab774788d72252c4dce0925f0bef20a60511f
2017-08-14 18:06:46 +00:00
Derek Sollenberger
4bc27b6e64 Switch default renderer to Skia's OpenGL pipeline.
This is the second attempt now that we have addressed many of the
correctness and performance concerns.

Bug: 63910712
Change-Id: I3df4ba52c2bc59930f577ffc8d889cb23a16a439
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases, CtsViewTestCases
2017-08-11 19:21:20 +00:00
Derek Sollenberger
27e9329d04 Revert "Switch default renderer to Skia's OpenGL pipeline."
This reverts commit 312a3a0c28.
Fixes: 64478761

Change-Id: I8caf95ead1b339447768b5e360a6d0b9705477de
2017-08-08 16:56:26 +00:00
Derek Sollenberger
312a3a0c28 Switch default renderer to Skia's OpenGL pipeline.
Bug: 63910712
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases
Change-Id: I901c236cfb5bfadcb59c449a76699479625944f9
2017-08-07 15:38:51 +00:00