Commit Graph

10251 Commits

Author SHA1 Message Date
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00:00
Ryan Mitchell
939df096be Add odm and oem policies
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.

Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
2019-04-17 16:07:57 -07:00
Winson Chiu
facddb4508 Merge "Skip idmap1 generation if target defines overlayable" into qt-dev 2019-04-16 17:53:54 +00:00
Leon Scroggins
949305fe52 Merge "Do not cache AVDs that are off screen" into qt-dev 2019-04-16 12:15:16 +00:00
Winson
1201ca7054 Skip idmap1 generation if target defines overlayable
Since idmap1 can't enforce policy restrictions, we can't allow it
to generate an idmap that might get used.

Migrating to idmap2 is too difficult for now as it requires a lot
of PackageManager infrastructure to validate policies, and none of
that is available during manifest parsing, which is where idmap1
is currently used.

Bug: b/130260055

Test: manual test BT issue from b/130260055
Test: manual test app with test overlay toggling Activity enabled

Change-Id: I5e7e321d27aab9be360a5e8be77d804ad3f66336
2019-04-15 15:31:39 -07:00
TreeHugger Robot
8d8d704cf7 Merge "Fix set_buffers_damage in VulkanSurface" into qt-dev 2019-04-15 21:00:08 +00:00
John Reck
08ca2a2560 Merge "Support render-ahead in vulkan" into qt-dev 2019-04-15 18:20:28 +00: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
321d8e538d Fix set_buffers_damage in VulkanSurface
Fixes: 130363483
Test: `setprop debug.hwui.renderer skiavk` and ensure
      surface damage in dumpsys surfaceflinger is expected
      in portrait & landscape orientations.

Change-Id: I973c47038e534c86f38112de7b863477d982d150
2019-04-12 13:06:11 -07:00
Leon Scroggins III
6c5864c098 Do not cache AVDs that are off screen
Bug: 128805564
Test: Manual + systrace; hwui_unit_tests; CtsUiRenderingTestCases

Only update a VectorDrawable's cache if it is onscreen. This fixes a
Twitter use case where the app has a ProgressBar that is exactly one
pixel offscreen. Prior to this CL, we repeatedly drew the ProgressBar's
AVD to a GPU surface, even though we clip it out later and never draw
that GPU surface. Now, we recognize that the AVD is outside of the
bounds of the screen, so we never draw to the GPU surface.

TreeInfo:
- store the size of the screen, retrieved from
  CanvasContext::getNextFrameSize.
SkiaDisplayList:
- Store the matrix at the time of recording a VectorDrawable. Concat
  that with the current matrix to determine whether the VD is on screen,
  based on the TreeInfo. If it is offscreen, do not add it to the list
  of AVDs that need to be updated ahead of rendering.
- In addition, if it is offscreen (or not dirty), do not call
  setPropertyChangeWillBeConsumed(true). This prevents triggering
  dispatchFrameCallbacks to update on the RenderThread when there is no
  need to. This also mimics what would happen if the View/RenderNode had
  been completely offscreen.
- Add a method to append an AVD to mVectorDrawables. Now that the vector
  is of Pairs, this simplifies the call sites. Add a second helper to
  just add an AVD without a matrix, for use in tests.
SkiaRecordingCanvas:
- get the current matrix and store it in the display list along with the
  AVD.
CanvasContext:
- add getNextFrameSize, for reporting the size of the next frame without
  dequeuing it
VectorDrawable.cpp:
- call quickReject to potentially short circuit drawing. This is for a
  hypothetical use case (verified in a test app) where the containing
  RenderNode is partially onscreen, but the AVD itself is not. Even
  without the change to VectorDrawable.cpp, we skip uploading to the GPU
  cache, the SkiaDisplayList still attempts to draw it. This change
  keeps us from drawing it at all.
SkiaDisplayListTests.cpp:
- Now that I've hidden mVectorDrawables, call the new public APIs.
- prepareListAndChildren test
  - for the clean VD, assert that getPropertyChangeWillBeConsumed
    returns FALSE. This is due to the behavior change that we do not
    set it unless the VD is dirty.
  - set the bounds, so our onscreen check works.
- Add another test for prepareListAndChildren, which puts VDs offscreen.

Change-Id: Iae0a07adcf58e7884e0854720de644e7b2faf2bf
2019-04-12 14:31:31 -04:00
TreeHugger Robot
8bffd47f7a Merge "Revert "Revert "Fix lifecycle issue in CommonPool""" into qt-dev 2019-04-10 17:42:09 +00:00
Leon Scroggins III
87e99a29aa Ensure that hardware Bitmap has a ColorSpace
Bug: 129355537
Test: I9e004fbb7c966bb58ae374087fecd66a1bb72346

android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode in
SkiaGL could create an android::Bitmap without an SkColorSpace. Treat
HAL_DATASPACE_UNKNOWN as sRGB, as this is how we treat it internally.

Change-Id: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
(cherry picked from commit 7fb4c9e4bb)
Merged-In: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
2019-04-10 12:10:52 +00:00
John Reck
cfd929dffd Revert "Revert "Fix lifecycle issue in CommonPool""
This reverts commit 162305aace.

Adjusted tests to ensure they pass on cf_x86

Bug: 129250875
Test: this on cf_x86 & blueline

Change-Id: Ic3245ec8db784ae356b7fa66dda9a2fc91c622ea
2019-04-08 16:30:22 -07:00
Derek Sollenberger
4670126b86 Respect the hardware buffer usage flags set by the consumer.
Test: CtsUiRenderingTestCases
Bug: 130121294
Change-Id: Ie77dee104fa8935978dfd6c0c506d2995f20cd79
2019-04-08 20:31:16 +00:00
TreeHugger Robot
da4d6e86a3 Merge "Revert "Fix lifecycle issue in CommonPool"" into qt-dev 2019-04-07 22:23:51 +00:00
David James
162305aace Revert "Fix lifecycle issue in CommonPool"
This reverts commit 5ff61f32a7.

Reason for revert: causes global presubmit to be very flaky, see b/130081457
Fixes: b/130081457

Change-Id: I93aa5d6686cd6b5bf831766c9e47c291749526a9
2019-04-07 04:28:50 +00:00
TreeHugger Robot
4108c7fca4 Merge "Allow non-references to be copied between AssetManagers" into qt-dev 2019-04-05 22:00:44 +00:00
Joe Onorato
1be371ddbd Merge changes I9706478e,I3fe2dea3,Ic65566c0 into qt-dev
* changes:
  Make libplatformprotos-static, which is safe to use when you don't have shared libraries.
  Add additional system properties that can disable the face debugging codepath
  Fix mMaxOffset not initialized.
2019-04-05 21:29:24 +00:00
Ryan Mitchell
93bca97e7c Allow non-references to be copied between AssetManagers
Hard-coded values in styles can be copied between AssetManagers even if
the source package is not present in the destination AssetManager. Only
references and strings should be prevented from being copied over
because they would be invalid in the destination AssetManager.

Bug:126400561
Test: manual
Change-Id: I970a3e961763b2c003c15b950d864a9a0b615022
2019-04-05 12:44:51 -07:00
John Reck
562888399c Merge "Fix lifecycle issue in CommonPool" into qt-dev 2019-04-05 17:59:10 +00:00
Joe Onorato
4796ae6f6a Fix mMaxOffset not initialized.
Test: bit GtsIncidentManagerTestCases:*
Bug: 129884655
Change-Id: Ic65566c02a255d1f52ce6876152383126afbfaef
2019-04-04 21:43:53 -07:00
John Reck
5ff61f32a7 Fix lifecycle issue in CommonPool
Destroy things more faster

Fixes: 129250875
Test: hwui_unit_tests
Change-Id: I7e060fcb61f5321dd9e68a3ee4a01868033b3fc3
2019-04-04 16:05:10 -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
TreeHugger Robot
ca3088a9aa Merge "Add per-file owner for CursorWindow.cpp" 2019-04-03 23:05:48 +00:00
TreeHugger Robot
7988315b01 Merge "Add support for /odm/overlay" 2019-04-03 21:56:39 +00:00
Makoto Onuki
878cbf8269 Add per-file owner for CursorWindow.cpp
(Need to merge it first to avoid merge conflict)

Test: N/A
Change-Id: I075ac3ec47743f5d9cd2acbd0cc01ce55cd1a8e3
2019-04-03 14:32:35 -07:00
Makoto Onuki
2276ceacb3 Improve CursorWindow failure message
Bug: 129139241
Bug: 129721058
Test: atest CursorWindowTest
Change-Id: Iac1c5ec6f999dadd638fc5ab47c69d13f60ea467
2019-04-03 16:01:33 +00:00
Mårten Kongstad
48c24cf149 Add support for /odm/overlay
Add support for runtime resource overlay (RRO) APKs in /odm/overlay.

Bug: 121033532
Test: manual (adb push apk to /odm/overlay, reboot, cmd overlay list)
Change-Id: I0918d276dfa6a43054068d3f84ecd0d1639f1d0b
2019-04-02 11:07:10 -07:00
TreeHugger Robot
0c682d04bd Merge "Add workaround for qualcomm vulkan AHDARDWAREBUFFER_USAGE_VENDER_0" 2019-04-02 13:37:05 +00:00
Greg Daniel
2173f1890c Add workaround for qualcomm vulkan AHDARDWAREBUFFER_USAGE_VENDER_0
Test: manual building and testing on device. Bugs related to lack of
flag go away.
Bug: 128923272
Change-Id: I2457988c097d73020162947c346a8716d373185e
2019-04-02 13:21:28 +00:00
TreeHugger Robot
d91a716cf3 Merge "Don't load EGL driver always" 2019-04-01 17:32:35 +00:00
TreeHugger Robot
b51fda1bc3 Merge "Invalidate Skia shader cache if Vulkan driver has changed" 2019-04-01 16:49:26 +00:00
Stan Iliev
30b9096352 Don't load EGL driver always
EGL driver is preloaded only if HWUI renders with GL.

Test: Ran several apps, passed CtsGraphics and CtsUiRendering
Change-Id: Ib38d6f51a19a2ee3631c7d9c99283286c389e476
2019-04-01 15:20:06 +00:00
TreeHugger Robot
4cb02be4c8 Merge "Fix NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS handling" 2019-03-30 00:31:22 +00:00
Winson Chiu
fbe87233d5 Merge changes from topic "code-paths-and-resources-caching-fix"
* changes:
  Revert ContextImpl LoadedApk packageInfo caching workaround
  Fix AssetManager2 isUpToDate check
  Diff resource dirs when checking LoadedApk packageInfo cache in ActivityThread
  Diff overlays between PackageManagerService and OverlayManagerService
  Propagate base code path and split dir changes to Resources objects
2019-03-29 23:50:02 +00:00
Winson
b0085ce5b6 Fix AssetManager2 isUpToDate check
This logic was lost in the AssetManager1 -> 2 migration.

The old AM1 checked the last modification time of the file
and compared it to a previously stored value. This re-adds the
logic to ApkAssets and fixes the checks in the JNI/Java layer.

Unfortunately I couldn't find a failing/practical case where
this check mattered. It only came up when diagnosing an issue
which ended up being unrelated.

Test: manually ran with other overlay changes

Change-Id: I758e4af1d32a9c03b2204a8a3a26e82b7e83feda
2019-03-29 12:18:18 -07:00
John Reck
fbeac3c39c Add missing trace points
Test: traced opening recents
Change-Id: I51675f1c49f27f1bfa5b18e3d3dd7162e58b1cb8
2019-03-29 11:24:56 -07:00
Stan Iliev
bf99c4450b Invalidate Skia shader cache if Vulkan driver has changed
Test: Ran apps several time and observed shader cache validation
Change-Id: I7c2620b9a0eefcb7acedc86647ecf44805518b2f
2019-03-29 11:18:21 -04:00
Stan Iliev
27b119ba5c Fix crash in Vulkan WebView drawable when parent View has alpha
HWUI uses SkPaintFilterCanvas to apply View alpha in nested draw
calls. This conflicts with new SkDrawable::snapGpuDrawHandler
API used by Vulkan WebView. The new API works only with GPU
device (see SkGpuDevice::drawDrawable), which SkPaintFilterCanvas
does not have (it uses SkNoPixelsDevice instead).
This CL uses new Skia API to find wrapped GPU canvas and
draw SkDrawable on it.
Improve SKP capture for Vulkan WebView to match GL.

Test: Ran Fandango app with Vulkan. Captured a SKP.
Bug: 128792554
Change-Id: I27040347dc25c799b4e75f50526f426e9e33b663
2019-03-29 13:49:20 +00:00
John Reck
ac513c2fde Fix NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS handling
Fixes: 123541940
Test: CTS HardwareRendererTests#testLotsOfBuffers
Change-Id: I5d96e615f552c4faa0e6dcaaaa828c871eaf6c8e
2019-03-28 16:57:38 -07:00
TreeHugger Robot
9d4dfc2ba0 Merge "Couple fixes to HardwareBitmapUploader." 2019-03-27 22:10:19 +00:00
Greg Daniel
78b7ddc12e Couple fixes to HardwareBitmapUploader.
When we had to make a copy SkBitmap for an unsupported format, we
were dropping the color space information.

Added a null check in terminate.

Test: manual build and running on blueline
Change-Id: I3cf386231e76b7505a691d006585918d343f6c96
2019-03-27 12:52:43 -04:00
Joe Onorato
ceece48518 Fix the build
Change-Id: I770ed6fd8de0479655f587db68a09882eb6cceb5
2019-03-27 00:23:20 -07:00
Joe Onorato
1c33a64705 Merge "incidentd can now handle multiple callers asking it for incident reports" 2019-03-27 04:06:06 +00:00
TreeHugger Robot
9db54bc0b3 Merge "Fix crash after dequeueNativeBuffer fails" 2019-03-27 01:02:57 +00:00
Stan Iliev
bc5f06bdaa Fix crash after dequeueNativeBuffer fails
Anytime dequeueNativeBuffer fails, it sets mDequeuedIndex to -1.
This is causing a crash latter, when getCurrentSkSurface tries
to index mNativeBuffers[mDequeuedIndex].
This CL removes mDequeuedIndex and improves Vulkan swapchain
error handling.

Test: Ran Camera app
Bug: 129024275
Change-Id: Ieeb685c3a1b33f23ce2334d286199a44ace53165
2019-03-26 15:14:34 -04:00
Joe Onorato
99598ee6ee incidentd can now handle multiple callers asking it for incident reports
Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9f671dd5d8b2ad139f952a23e575c2be16120459
2019-03-26 11:20:48 -07:00
Bo Liu
d336f5d95f Deprecate is_layer for vulkan functor
Webview no longer needs this.

Bug: 124123583
Test: comppiles and vulkan webview in layer keeps working
Change-Id: Ib54e33649eb027a03184c5d7588cfd9568c90a6c
2019-03-25 09:34:27 -04:00
TreeHugger Robot
8f8deb20b3 Merge "Use VkAndroidHardwareBufferUsageANDROID to compute HWUI usage flags" 2019-03-22 04:19:44 +00:00
Derek Sollenberger
31c1b82ad7 Use VkAndroidHardwareBufferUsageANDROID to compute HWUI usage flags
Bug: 128923272
Test: atest CtsUiRenderingTestCases
Change-Id: I27db1a35b77fb654ab738520bee6734f6a62cc4f
2019-03-21 13:24:26 -04:00