Commit Graph

10153 Commits

Author SHA1 Message Date
Stan Iliev
898123b6a3 Start RenderThread earlier to preload Vulkan/EGL drivers
This CL should fix application startup regression for Vulkan
detected by "Hermetic Startup: EmptyActivity" test.
EGL drivers are loaded in a temp thread to leave more time
in RenderThread for other work. Loading EGL drivers
on the RenderThread may cause a perf regression.

Test: Ran cold-dropcache-test test.
Bug: 122659224
Bug: 123361175
Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
2019-02-20 02:10:52 +00:00
John Reck
700079e817 Fix RenderThread setForLooper
RenderThread doesn't use ThreadBase::threadLoop
so it also needs to explicitly Looper::setForLooper

Fixes: 124467483
Test: hwuiunit
Change-Id: I3703b5d3dbbbaa68e88fc23756dfccacfce863cb
2019-02-19 10:38:50 -08:00
Winson Chiu
6c0dbe1371 Merge "Signature policy for overlayable items" 2019-02-15 20:50:04 +00:00
TreeHugger Robot
826e270caa Merge "Add more alert details to incidentd header." 2019-02-15 19:53:22 +00:00
John Reck
8a7428020c Merge "Add missing Looper::setForThread" 2019-02-15 17:26:24 +00:00
John Reck
352e9f0b7a Add missing Looper::setForThread
Unlike the Java Looper the native one requires manually
setting of the looper for a particular thread.

So... do that.

Fixes: 124467483
Test: really good guess
Change-Id: Iac9b4a052e79228aea5760262996729d8dadb1b8
2019-02-14 16:26:08 -08:00
Winson
b2d7f5343d Signature policy for overlayable items
Add encoding/decoding of new policy for overlays. Signature enforces
that an overlay package is signed with the same key as the actor of
the target resource, so that an overlay can be installed by the user
as a normal app but restricted to those built by the author of the
actor (which can be the same as the target).

This also enforces that a valid policy is specified.

This doesn't implement the actors nor the signature check.

Bug: 119402606

Test: ResourceParserTest ParseOverlayablePolicy
Test: ProtoSerializerTest SerializeAndDeserializeOverlayable
Test: aapt2_tests

Change-Id: I8495ad790c2ebd51759bc6eba81149680c209475
2019-02-14 10:07:13 -08:00
Yao Chen
4ce07298e0 Add more alert details to incidentd header.
+ Add metric_id, dimension, metric_value in the incident report header
  to make it easier to identify an anomaly.
+ In case there is a uid in the dimension, put the its package info in the header too

Test: statsd_test && tested locally with a config

Change-Id: I762a1a4b0563fb3104e0d32b616b4a2367485e48
2019-02-13 17:21:42 -08:00
TreeHugger Robot
a99c4f30ee Merge "Support showTouches on multi-display (2/2)" 2019-02-14 00:54:22 +00:00
TreeHugger Robot
cb26eb117b Merge "Decouple VulkanManager from RenderThread" 2019-02-13 23:33:17 +00:00
Stan Iliev
981afe773a Decouple VulkanManager from RenderThread
This CL allows for more than one VulkanManager to exist.
VulkanManager ctor are public allowing for classes other
than RenderThread to instantiate it.
Secondary VulkanManager can be used to render on a thread
other than RT.

Test: Ran HWUI unit tests and several apps
Change-Id: Ibfd76c86ff67e01617a500902bba7431b928f5c0
2019-02-13 15:55:45 -05:00
Arthur Hung
d25699a122 Support showTouches on multi-display (2/2)
Currently the PointerController would be associated with the top most
freeform or external display if enable desktop mode.
But for presenting spots when enable showTouches from develop options,
they should be shown on the corresponding display where user touched.

Also changed Vector to std::vector.

Test: atest inputflinger_tests
Test: Use device support multi-display and touch screen (like mojave).
      Enable showTaps from develop options and check if show tap spots.
Bug: 120815589

Change-Id: I0854fa97813aabf005dccb8ec6fbda10106126e9
2019-02-13 16:23:22 +08:00
Pirama Arumuga Nainar
7a6e219539 Merge "Mark FrameMetricsObserver::notify() as pure virtual" am: 0b3cef8697 am: fec4795045
am: dbeb139e26

Change-Id: I4194a12a2f7b3fadc5e442590946d1de2dd63f17
2019-02-12 18:48:55 -08:00
Pirama Arumuga Nainar
dbeb139e26 Merge "Mark FrameMetricsObserver::notify() as pure virtual" am: 0b3cef8697
am: fec4795045

Change-Id: I241a6dc1e5dca8ffdc546ff44ea61dad5963dfe2
2019-02-12 18:33:24 -08:00
TreeHugger Robot
44b8309ea2 Merge "Surface <overlayable> info in Java AssetManager" 2019-02-11 03:55:13 +00:00
TreeHugger Robot
e26f4ee555 Merge "Remove the IncidentHeaderProto dependency from statsd." 2019-02-08 20:13:14 +00:00
Mårten Kongstad
c92c4dd6c6 Surface <overlayable> info in Java AssetManager
Add a new, hidden method to AssetManager to extract a mapping
overlayable name -> overlayable actor for all <overlayable> blocks in a
package. [This will eventually be used to check if the caller of the OMS
AIDL API is the registered actor for a given overlay.]

Also, teach AssetManager2 to not accept packages that re-use the same
overlayable name. [Such packages have always been ill-formed.]

Bug: 123894537
Test: make libandroidfw_tests
Change-Id: I1117fd3503f04fe4c73eb7114901e022508f4d9e
2019-02-07 14:32:16 -08:00
Pirama Arumuga Nainar
459afe96d1 Mark FrameMetricsObserver::notify() as pure virtual
Bug: http://b/116873221

If not, Clang assumes that the TU which defines this function will
contain the vtable for the class as well.  Since there's no out-of-line
definition of this funciton, no TU ends up with the vtable.

This causes a problem with coverage builds, which are built with -O0,
where calls don't get inlined, thereby requiring a definition of the
vtable.  For non -O0 builds, the vtable is not required since the
virtual calls get inlined/optimized-out.

Test: Build with and without -O0.
Change-Id: I60a5cefcd1c327f1e00785fedbb2163c682b33d1
2019-02-07 13:24:24 -08:00
Aurimas Liutikas
86ef44bcc7 Merge "Add helper methods for View attribute debugging" 2019-02-07 19:05:20 +00:00
Yao Chen
ec216489fc Remove the IncidentHeaderProto dependency from statsd.
+ IncidentReportArgs takes the bytes instead of IncidentHeaderProto object

This cl is the ag/6287053 + build fix.

Test: incidentd_test && statsd_test
Change-Id: I86bcb48f4ab212b36ca4611a1fa05faace9c3702
2019-02-07 09:45:13 -08:00
Nandana Dutt
9ed7c41017 Revert "Remove the IncidentHeaderProto dependency from statsd."
This reverts commit df6255a0c1.
Reason for revert: Breaks git master
Test: manual confirm

Change-Id: Ifd8f437dce826fe7d8f875fc838a250fc010049a
2019-02-07 12:24:32 +00:00
TreeHugger Robot
2b92401717 Merge "Remove the IncidentHeaderProto dependency from statsd." 2019-02-07 04:16:40 +00:00
Yao Chen
df6255a0c1 Remove the IncidentHeaderProto dependency from statsd.
+ IncidentReportArgs takes the bytes instead of IncidentHeaderProto object

Test: incidentd_test && statsd_test
Change-Id: Ifb0929ca374a8791cdf8f79f74bdd7c91521139e
2019-02-06 17:02:17 -08:00
Aurimas Liutikas
8f004c85a0 Add helper methods for View attribute debugging
Adding abilities to debug:
- Attribute resolution stack (which resources are looked
  at when resolving an attribute)
- Attribute value source (where did each attribute value
  get defined)
- Get explicit style id (if a view had it set via style="...")

This feature will be behind Settings.Global flag that Android
Studio will set to the debugged application package ID.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewStyleTest
Change-Id: Ib6f9fc81000bb867b5b94a68953c99b0bc802d6c
2019-02-06 14:46:17 -08:00
Dominik Laskowski
9e7dce3833 Merge "Generalize physical display management" 2019-02-06 22:46:09 +00:00
TreeHugger Robot
38ce8c2116 Merge "Use kTopLeft_GrSurfaceOrigin when generating a GPU buffer for CPU readback." 2019-02-06 21:20:52 +00:00
TreeHugger Robot
60ddf9b48a Merge "Fix RenderThread and worker thread names used by tools" 2019-02-06 19:43:58 +00:00
Derek Sollenberger
f4795f51f0 Use kTopLeft_GrSurfaceOrigin when generating a GPU buffer for CPU readback.
When attempting to read back a buffer from the GPU, Skia will perform a
y-flip of the buffer in CPU memory if the buffer does not have a
top-left origin.

Test: CtsUiRenderingTestCases
Bug: 119366261
Change-Id: I93ec93cc31209cbdd9b886b0d1020fda3aac646e
2019-02-06 13:54:12 -05:00
Stan Iliev
978d5321b4 Fix RenderThread and worker thread names used by tools
Test: collected systrace and RenderThread hwuiTask1/2 shown
Change-Id: I1114ff72a7ed8c9dc86a64ebd15ca783d1b2ff08
2019-02-06 12:02:28 -05:00
Ryan Mitchell
6cb185eede Merge "Enforce overlayable API when defined" 2019-02-06 03:13:31 +00:00
TreeHugger Robot
b3cd68bc82 Merge "Tell JVM to not wait for HWUI worker threads upon shutdown" 2019-02-05 23:41:59 +00:00
TreeHugger Robot
04c971ecf9 Merge "Implement batch horizontal advances callback" 2019-02-05 22:37:53 +00:00
Stan Iliev
80dbc35555 Tell JVM to not wait for HWUI worker threads upon shutdown
RenderThread is setup as a daemon thread, which allows JVM to
exit without waiting on it. This CL does same setup for HWUI
worker threads, which offload work from the RenderThread.
This fixes an issue exposed by Vulkan pipeline, which is pushing
different loads to the worker threads and causing some java tests
to hang on exit. This is not a Vulkan specific issue, because GL
also hangs if worker thread is started.

Bug: 123374538
Test: Ran DismissDialogsInstrumentation test
Change-Id: Ie4ee94737ced975323a0792f57f8426c958e8056
2019-02-05 16:26:58 -05:00
Christopher Dalton
adafb1b44e Merge "Enable CCPR in Ganesh" 2019-02-05 19:11:31 +00:00
Ryan Mitchell
198234502b Enforce overlayable API when defined
If a package defines overlayable resources, then do not allow resources
that are not defined as overlayable to be overlaid.

Bug:123600120
Test: idmap2_tests and cts-tradefed run cts -m CtsRROTestCases
Change-Id: I35120a97ccf4650e67c7ba65a60f4f3c51b0e627
2019-02-05 07:56:50 -08:00
Seigo Nonaka
1090f49c5a Implement batch horizontal advances callback
The SkFont's overhead is not negligible if we performs glyph width
computation one-by-one. HarfBuzz now supports batch width request,
so let's use it for aoviding SkFont's overhead.

Here is the raw performance scores:

android.text.StaticLayoutPerfTest:
  create
    RandomText Balanced Hyphenation       : 16,311 -> 15,253: (-1058, -6.5%)
    RandomText Balanced NoHyphenation     :  6,679 ->  6,164: ( -515, -7.7%)
    RandomText Greedy Hyphenation         :  6,614 ->  6,083: ( -531, -8.0%)
    RandomText Greedy NoHyphenation       :  6,613 ->  6,090: ( -523, -7.9%)

Bug: 123907498
Test: minikin_tests
Test: hwui_unit_tests
Test: atest CtsTextTestCases
Test: atest CtsGraphicsTestCases
Test: atest CtsWidgetTestCases
Test: TreeHugger
Change-Id: I5a33e24aa0b5d865f02518c5e80177d5a7706593
2019-02-04 21:07:41 -08:00
Bo Liu
d25d1345a3 Do not call postDrawVk if did not call drawVk
Reland enable vulkan webview functor

Bug: 123877499
Bug: 115613038
Test: Gmail in bug no longer crashing.
Change-Id: I7df761a4691ceaa6c2a02b256d61554e57139409
2019-02-04 20:02:18 -08:00
TreeHugger Robot
30780a26f4 Merge "Revert "Enable vulkan webview draw functor"" 2019-02-05 01:15:34 +00:00
Bo Liu
a2b2535bd7 Revert "Enable vulkan webview draw functor"
This reverts commit dec730fda5.

Reason for revert: b/123877499

Change-Id: I14fc562c81f5ef5dab0f5404402b64858e54e364
2019-02-04 23:05:44 +00:00
TreeHugger Robot
26a4e7ab0e Merge "Fix crash when VulkanSurface is no longer valid" 2019-02-04 20:14:57 +00:00
Dominik Laskowski
3316a0a08e Generalize physical display management
This CL enables the framework to manage an arbitrary number of physical
displays. It also surfaces physical display IDs, which are stable across
reboots and encode (model, port) information that will be propagated
further up in a follow-up CL.

Bug: 116025192
Test: Boot with more than two displays
Test: Hotplug works with any number of displays
Test: Verify stable display IDs with "dumpsys display"
Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
2019-02-04 10:06:15 -08:00
Stan Iliev
90276c8621 Fix crash when VulkanSurface is no longer valid
SkiaVulkanPipeline::mVkSurface can become obsolete if
RenderThread destroys Vulkan context. This CL enables
RenderThread to notify active Vulkan pipelines that their
surface is invalid.
Improve error handling, when trying to draw a frame with null
VulkanSurface.

Bug: 123640274
Bug: 123541940
Test: Ran several apps
Change-Id: If7fba00713d097192c96179df36e90b54f4f8090
2019-02-04 11:51:20 -05:00
TreeHugger Robot
b8800246cd Merge "IWYU" 2019-02-02 00:46:38 +00:00
Aurimas Liutikas
ce37d9027d Merge "Update TypedArray and TypedValue to store source layouts." 2019-02-01 20:35:23 +00:00
Mike Reed
c1f5e5ab6e IWYU
Motivated by https://skia-review.googlesource.com/c/skia/+/188630

Test: make

Change-Id: I0e4c19e863eb020c2bd8a242cf87fc768a13811c
2019-02-01 20:04:53 +00:00
TreeHugger Robot
199b8ca10e Merge "Cache SkImage in SurfaceTexture only if buffer content is same" 2019-02-01 15:44:59 +00:00
Aurimas Liutikas
949b05dbdc Update TypedArray and TypedValue to store source layouts.
In ag/5859897 we started tracking source styles for each TypedValue.
It is also useful to keep track of source layouts if the attribute
was resolved against a layout (attribute set in XML layout inside
of <View> tag).

Test: atest CtsContentTestCases:android.content.res.cts.TypedArrayTest
Bug: 111439551
Change-Id: Ie6bc6ecd9a22b536a2f3288263b896f9cec67d38
2019-01-31 15:44:51 -08:00
Leon Scroggins III
1249757910 Remove references to ANDROID_ENABLE_LINEAR_BLENDING
Test: make

There is no longer any intent to turn on linear blending.

Change-Id: Ia1016f31833212da6ad4b4c6ebe03d16a509746d
2019-01-31 14:25:32 -05:00
Leon Scroggins III
ee3bfe7681 Only decode to F16 if HARDWARE supports it
Bug: 123301974
Test: Infeasible

If a Bitmap is going to be decoded to F16 and then converted to
HARDWARE, only decode to F16 if HARDWARE supports it.

Previously, if we discovered after the decode that HARDWARE did not
support F16, we had to copy back to 8888 before the upload.

Change-Id: I3ceb9d053ba134bb96cfb9d638e54ac652e5db29
2019-01-31 10:38:26 -05:00
TreeHugger Robot
e703b1985f Merge "Enable vulkan webview draw functor" 2019-01-31 03:41:29 +00:00