5748 Commits

Author SHA1 Message Date
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Brett Chabot
ab73aec1e4 Lazy load Properties::isDrawingEnabled.
Properties::isDrawingEnabled can unexpectedly return true
even if the system property debug.hwui.drawing_enabled is false,
if its called before RenderThread is created.

This commit changes the underlying logic to lazy load the
debug.hwui.drawing_enabled prop value.

Bug: 201691826
Test: m
Change-Id: I599426c8734d418f073fd0456c2b1149fb69d80c
2021-10-27 21:22:03 +00:00
Brett Chabot
3f8b9fe50b Backport 'Add ability to disable GL draws'.
This feature is intended for use in headless test environments,
where disabling drawing has minimal compatibility impact and can
save significant resource usage when running UI tests.

This feature is controlled via a new system property
'debug.hwui.drawing_enabled', and a HardwareRenderer API that can
override the property value on a per-process basis.

Bug: 201691826
Test: boot emulator
Merged-In: I93c21e680382e03342f235dbf58bd7a5c8a6f767
Change-Id: I391c841e3a0cdcfcc6c7910a316a4dd5e970547d
2021-10-26 21:16:16 +00:00
John Reck
ab55cd0ae8 Merge "CTS of CtsMediaTestCases#android.media.cts.DecodeAccuracyTest may fail when video is cropped. When we use GPU to copy the data, rendering would choose filter. But we need add shrink in border to ensure the sampler not reach border like what GUI does." am: 06e16941d5 am: 44bfae1759 am: b0838b910c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801770

Change-Id: I61cf7080c1f4398f6658263fcf14746268e6b3a5
2021-10-04 17:21:55 +00:00
John Reck
b0838b910c Merge "CTS of CtsMediaTestCases#android.media.cts.DecodeAccuracyTest may fail when video is cropped. When we use GPU to copy the data, rendering would choose filter. But we need add shrink in border to ensure the sampler not reach border like what GUI does." am: 06e16941d5 am: 44bfae1759
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801770

Change-Id: I7407b24f046f8339ab0998095bbd0c80fc940831
2021-10-04 17:06:22 +00:00
John Reck
44bfae1759 Merge "CTS of CtsMediaTestCases#android.media.cts.DecodeAccuracyTest may fail when video is cropped. When we use GPU to copy the data, rendering would choose filter. But we need add shrink in border to ensure the sampler not reach border like what GUI does." am: 06e16941d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1801770

Change-Id: I1e34d4b25af83a4761e7a2fc81bf5b79d7b2aa08
2021-10-04 16:45:17 +00:00
John Reck
b48d4d10ab CTS of CtsMediaTestCases#android.media.cts.DecodeAccuracyTest may fail when video is cropped.
When we use GPU to copy the data, rendering would choose filter. But we need add shrink in border to ensure the sampler not reach border like what GUI does.

Change-Id: I2c59956f3d7a7052d8e4bee587360f252a6c5549
Signed-off-by: Chun Jiang <chun.jiang@mediatek.com>
Bug: 197180327
Test: CTS PixelCopyTests & DecodeAccuracyTest
2021-10-01 16:30:11 -04:00
Nader Jawad
201db897ea Merge "Fix initialization of snapshot SkImage instance" into sc-qpr1-dev am: be0bdf6178
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15926060

Change-Id: Ie233dd9f6628ac6780dd0b96d8eca97d7892b929
2021-09-28 18:40:56 +00:00
Nader Jawad
74eaabead9 Fix initialization of snapshot SkImage instance
Fix issue where the initial snapshot used to create a
resultant SkImage instance with an SkImageFilter applied
was not initialized.

Fixes: 201312688
Test: Re-ran CTS tests
Change-Id: I2440a161c70076850479c562c7c9e6dc8d756236
2021-09-28 02:30:40 +00:00
Nader Jawad
53290d8b19 Merge "Conditionally cache RenderEffect results" into sc-qpr1-dev am: 69617682e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15882028

Change-Id: I4292aa197b018d67e3830989f4310f46c182a377
2021-09-22 18:44:41 +00:00
Nader Jawad
4a6b60a5a8 Conditionally cache RenderEffect results
Added property to conditionally cache SkImage instances
with SkImageFilters applied. Some GL vendor implementations
invoke Fence::waitForver without signalling, leading
to ANRs throughout the system.

Bug: 193145089
Test: manual
Change-Id: I3e478b11b66205d96e9499a362f7412a1d6e952d
2021-09-22 02:27:33 +00:00
Yi Kong
654f9a53f5 Merge "Fix an instance of -Wunused-but-set-variable." am: c10adebed6 am: daa2a19c60 am: fdf7486ad5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829955

Change-Id: I3e9b52912f94db42f02a31e19047187c0e66faa7
2021-09-18 08:40:16 +00:00
Yi Kong
fdf7486ad5 Merge "Fix an instance of -Wunused-but-set-variable." am: c10adebed6 am: daa2a19c60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829955

Change-Id: I1b2e62708ebe008ad5e22b563c1dc18b55bb2295
2021-09-18 08:26:17 +00:00
Yi Kong
daa2a19c60 Merge "Fix an instance of -Wunused-but-set-variable." am: c10adebed6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1829955

Change-Id: I7095f3e7ce171f0be9402d91475b74e623316545
2021-09-18 08:14:34 +00:00
Yi Kong
b5cab25730 Fix an instance of -Wunused-but-set-variable.
Test: presubmit
Bug: 197240255
Change-Id: Iedb28903cfada8d23e931196b72059a0fc8797aa
2021-09-18 02:28:22 +08:00
Nader Jawad
48f7fabf25 Fix aggressive caching of RenderNode snapshot
Updated ImageFilter caching logic to update the snapshot
whenever the surface generation ID has changed.

Fixes: 199242895
Test: Added test to RenderNodeTests
Change-Id: I803dce35ba15a098f14dc02a479abf8b2fbae51f
2021-09-09 18:58:17 +00:00
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
9107a62bb4 Remove Webview Overlays on destroy
When WebViewFunctor is destroyed, overlays needs to be removed.
Bug: 194393522
Test: toggle fullscreen during video playing, and run "adb shell dumpsys
SurfaceFlinger | grep Webview", it should only show onlyi one surface
control

Change-Id: I40d0e503c4f5b25c59886820485e7734716ac859
(cherry picked from commit 9c5158f7a2f3bff0ccfc8e071143aac7b5c95049)
2021-08-12 20:48:22 +00:00
Leon Scroggins III
7fbd0ad0f9 CanvasContext::draw: flushAndSubmit when not drawing
Bug: 195081399
Test: manual + dumpsys gfxinfo

CanvasContext::draw has some conditions under which it will not draw. We
still need to flushAndSubmit to free scratch memory if there were
texture uploads this frame.

Change-Id: I60d230cd36bed310a3155e4f1ca647c99c13c4cd
2021-08-06 13:42:49 -04:00
Bo Liu
6a3fc60f43 Switch HWUI to use native performance hint API
Test: None
Bug: 194204196
Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
2021-07-22 11:33:01 -04:00
TreeHugger Robot
f560a753fd Merge "In VuklanManager make sure we have a valid semaphore context before destroying it." into sc-dev 2021-07-16 21:26:53 +00:00
John Reck
53c02ec9fd Merge "Adjust declared usage for createHardwareBitmapFromRenderNode" into sc-dev 2021-07-15 23:32:01 +00:00
John Reck
f13447030d Avoid sampling outside BQ crop rect
The region outside of the BQ crop rect is potentially
garbage. Avoid sampling from it.

Fixes: 189656466
Bug: 193378020
Test: CTS PixelCopyTests & DecodeAccuracyTest
Change-Id: I2910d93471f08aaf807ac9f87fdf84cf29cf4143
Merged-In: I2910d93471f08aaf807ac9f87fdf84cf29cf4143
2021-07-15 18:48:20 +00:00
Greg Daniel
e8dc397bfd In VuklanManager make sure we have a valid semaphore context before destroying it.
If errors occured during finishFrame that caused us to not have a
semaphore or possibly destroy the semaphore early we will end up
with a null mDestroySemaphoreContext in swapBuffers which we tried
to destroy unconditionally.

I haven't repro'd the connected bug, but based on the crash stack
this seems like the likely cause.

Test: manual code inspection and build.
Bug: 191950033
Change-Id: I0fbd33edff3552b91b980da9e3b2c45bc52a2dd0
2021-07-15 13:38:44 -04:00
John Reck
6c213067c9 Adjust declared usage for createHardwareBitmapFromRenderNode
Fixes: 182901940
Test: make && atest CtsUiRenderingTestCases
Change-Id: I0f911463bcf819ef2350e95eaeef099d9edfa866
2021-07-15 16:44:52 +00:00
John Reck
6a84070852 Merge "Always submit after texture uploads" into sc-dev 2021-07-15 15:27:50 +00:00
John Reck
cf1170fbda Always submit after texture uploads
Ensure GrContext::submit() is always called after either
Bitmap#prepareToDraw() or if DrawFrameTask skipped drawing.

In either case texture uploads & deletions will be scheduled,
but without the submit they won't actually be performed. This
can end up running out of RAM.

Bug: 189393671
Test: manual test app
Change-Id: I57477c64457558487e9e5ec0a979ad9099a8cb2c
2021-07-14 17:06:28 -04:00
John Reck
0f284da923 Avoid sampling outside BQ crop rect
The region outside of the BQ crop rect is potentially
garbage. Avoid sampling from it.

Fixes: 189656466
Test: CTS PixelCopyTests & DecodeAccuracyTest
Change-Id: I2910d93471f08aaf807ac9f87fdf84cf29cf4143
2021-07-14 14:26:14 -04:00
TreeHugger Robot
1e67f86165 Merge "Properly protect mFrameMetricsReporter" into sc-dev 2021-07-11 08:30:13 +00:00
Siarhei Vishniakou
07d35cb7dc Properly protect mFrameMetricsReporter
This field actually requires a special lock, mFrameMetricsReporterMutex.
But there isn't a GUARDED_BY annotation for it. And even if there was,
the compiler feature of -Wthread-safety was not active in this code, so
this error would not have been caught.

To fix this, enable the compiler annotation and add GUARDED_BY
annotation to mFrameMetricsReporter.
And finally, use this lock to properly protect this field.

Bug: 192330836
Test: atest hwui_unit_tests
Change-Id: I76950bfa01bbd7ccdc54c4e8c114430b5aeddf1a
2021-07-09 00:32:29 +00:00
John Reck
b7039c6aa5 Reduce number of weakrefs per frame
Disable end-to-end input latency metric to reduce the
number of JNI WeakGlobalRef acquires per-frame.

Bug: 189738006
Test: Observe trace section no longer appears in calculator
Change-Id: I062dad8e7cec93cca5599e51d2b0b1a1b6e39a07
2021-07-07 19:18:34 -04:00
Huihong Luo
ec68b7c973 Disable Webview Overlay when invisible
Remove Webview overlays when Webview node is set to invisible

Bug: 187292989
Test: play a video in a Webview, toggle visibility for the view, check
existence of a surface control named as "Webview Overlay
SurfaceControl#0"

Change-Id: If47a78a8ae1f7b65b9e7ab983ec72f580d78191a
2021-07-01 11:50:53 -07:00
Greg Daniel
351080a8f5 Merge "Make sure we check for valid GrContext when pinning images." into sc-dev 2021-07-01 01:59:40 +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
Greg Daniel
f8cb525497 Make sure we check for valid GrContext when pinning images.
Test: manual building and running.
Bug: 187540936
Change-Id: Ie900d80128646c8ca2d4fce41d436019e3cf9c71
2021-06-30 12:06:53 -04:00
Huihong Luo
540fdf89b1 Reparent surface control for Webview overlay
When the root surface control changes, the parent of the Webview surface control must be changed.

Bug: 191900007
Test: switch app, or turn on/off screen
Change-Id: Ib7b34133776fd5944afc638bfee471afe6a17349
2021-06-28 20:36:40 -07:00
TreeHugger Robot
544b5f5b2e Merge "vsyncId should always be incremental" into sc-dev 2021-06-28 23:58:30 +00:00
George Mount
5a1f9df840 Merge "Linearly complete overscroll stretch when close" into sc-dev 2021-06-28 17:10:31 +00:00
John Reck
e947e2e20a Merge "Revert "Delete RenderProxy off of the cleaner thread"" into sc-dev 2021-06-25 19:00:24 +00:00
John Reck
f0b6921e89 Revert "Delete RenderProxy off of the cleaner thread"
This reverts commit da3559683482a61d93b06bed6f46349f6f01dc63.

Bug: b/192050906

If too many RenderProxies are destroyed too quickly, we can end up jamming up the CommonPool preventing RenderThread from making progress if it's waiting on CommonPool tasks.

Change-Id: I8c324bc60891440d9b7be67961f8d5f881dc0f03
2021-06-25 18:59:47 +00:00
Rob Carr
472d962453 Merge "Delete RenderProxy off of the cleaner thread" into sc-dev 2021-06-25 02:18:17 +00:00
John Reck
da35596834 Delete RenderProxy off of the cleaner thread
Speculation for the cause of an ANR. HardwareRenderer's
cleaner can block on RenderThread, which in turn blocks ART's
cleaner thread. This can potentially cause other blockages, but
it's also poor behavior to have such a long-running Cleaner anyway.

Avoid this by putting cleanup to CommonPool.

Bug: 191514384
Test: make, CtsUiRenderingTestCases still passes

Change-Id: I8190f7862528c3ac39ce636f6fca229322480968
2021-06-24 21:58:05 +00:00
Huihong Luo
4df4151bc0 Fix a crash caused by transaction
A native transaction passed from webview is sent back to native side, so java side does not manage the life cycle of the transaction.

Bug: 191414767
Test: Play a video, switch to another app, wait for 10 seconds
Change-Id: I013052c202b445438d6cb6497f5f9a2fc22a2b85
2021-06-24 11:10:06 -07:00
Ady Abraham
505e730e7d vsyncId should always be incremental
In some conditions of scheduling delays, Choreographer may
synthetically advance the indented vsync time. In that case we can't
send a vsync id since there is no one that corresponds to that time.

Test: TBD
Bug: 191840734
Change-Id: I7b2754d5dcb0a3f5fd6cda00a3a2469041116f67
2021-06-23 15:04:04 -07:00
George Mount
22a9f9c83e Linearly complete overscroll stretch when close
Fixes: 190475978

Damped spring animations asymptotically approach their destinations.
The final pixels can take many frames to complete, but stopping them
means that we get a disruptive jump in those final pixels.

This CL detects when the edge effect animation is close to the finish and
completes the animation with a linear velocity that matches a
common velocity at 8 pixels distant. This means that the animation
terminates quicker so that touch events directed at the contents
after the animation completes (e.g. taps) can interact with the contents
soon.

The CL also adjusts the delta for detecting zero in the stretch
animation as it was jumping by a pixel or more at the end of an otherwise
smooth animation.

Test: manual testing for the visual effect
Change-Id: Ie249b0265c5c5939b597668d5afe4f76d0430821
2021-06-23 21:25:04 +00:00
Nader Jawad
3206cce503 Fix: Release skia resources when RenderNode layer is configured
-Updated StretchEffect to null out the child texture
of the SkRuntimeEffectBuilder after the shader is created
-Release optional mask surface used for
stretching the hole punch
-Release SkRuntimeEffectBuilder instance on RenderNode's
StretchEffect

Fixes: 183592264
Test: manual + re-ran cts tests
Change-Id: I90952666d7489985de9ce798ab792cf3fd7f6087
2021-06-23 11:48:58 -07:00
Huihong Luo
17410b668f Merge "Fix z-order for webview surface control" into sc-dev 2021-06-18 19:53:34 +00:00
TreeHugger Robot
5001447b86 Merge "Remove the extra buffer allocation from hwui" into sc-dev 2021-06-18 17:21:39 +00:00
Huihong Luo
34f42fdecd Fix z-order for webview surface control
Set the root surface control transparent, and set the z order of the newly created child surface control to -1.
A new callback is needed to update root surface control in sync from Java side.

Bug: 186750329
Test: use latest APKs from Webview team, play a video, mini toolbar should be visible
Change-Id: I0b37ee8f83fd2b41ff4f2856dbadd31ff6170baf
2021-06-18 10:14:22 -07:00
Nader Jawad
2b9301d01f Merge "Improve snapshot clearing consistency" into sc-dev 2021-06-17 22:32:33 +00:00