summaryrefslogtreecommitdiff
path: root/libs/hwui
AgeCommit message (Collapse)Author
2022-02-14Fix a mismatch in Bitmap_createFromParcelJohn Reck
Test: atest android.security.cts.BitmapTest Bug: 213169612 Change-Id: I03330acca99b6e62668ab7c1325f2f93361b2b50 (cherry picked from commit a52463fd6e71dd0563b3fd8883b4ccaf9f858e8b) Merged-In:I03330acca99b6e62668ab7c1325f2f93361b2b50
2021-11-24Rework blast sync callback modelchaviw
The previous code waited for a frame complete callback from hwui before notifying WMS that a draw had occurred. However, frame complete callback was not guaranteed to get called since it only invokes a callback if a draw actually occured. VRI really needs a signal that RT has completed, since it just needs to know that a draw was possible so it can notify WMS that the RT completed its pass. Instead, rename frameCompleteCallback to frameCommitCallback since that API is exposed to a public API when a frame was actually drawn. Create a new callback, frameCompleteCallback, that is invoked when the draw has completed, regardless if a frame was actually drawn. When the frameCompleteCallback is invoked, VRI can check to see if a new frame actually drew. VRI can call into BBQ to see if the frame acquired matches the frame that was attempted to draw. If so, VRI can wait on a transaction callback. If not, it can allow VRI to continue. In either case, it will notify WMS that the draw has finished. Test: Split over and over Bug: 195262673 Bug: 193634619 Change-Id: I24dd19ab2746be3fc33e597761abf8c5249f8b5b Merged-In: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
2021-11-10Skip TransformCanvas calls for FunctorDrawablesNader Jawad
Fix issue where attempts to render overscroll content into the alpha 8 mask would crash if there are WebView related Functors in the scene. Provide implementations for getTypeName in SkDrawable instances of FunctorDrawable. Fixes: 203960959 Test: manual Change-Id: Idf321d9bfcbe2b8ba1eb205eadcec95e55865305
2021-10-08Update RenderEffectCache capability queryNader Jawad
Updated logic to determine if RenderEffectCache is supported to very both the vendor name as well as the corresponding driver version. Bug: 193145089 Test: Added test to EglManagerTests + RenderEffectCapabilityQueryTests Change-Id: Ia0fd66c40790b94566f495d2c4128c4988d406b6
2021-09-28Merge "Fix initialization of snapshot SkImage instance" into sc-qpr1-dev am: ↵Nader Jawad
be0bdf6178 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15926060 Change-Id: I601044300fbea039823b2bfad37d59cc4fec6ed5
2021-09-28Fix initialization of snapshot SkImage instanceNader Jawad
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-27Merge "Conditionally cache RenderEffect results" into sc-qpr1-dev am: 69617682e4Nader Jawad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15882028 Change-Id: I7a3ff706eb350073535595c1fc79f97a71e4489e
2021-09-22Conditionally cache RenderEffect resultsNader Jawad
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-09Fix aggressive caching of RenderNode snapshotNader Jawad
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-09Fix aggressive caching of RenderNode snapshotNader Jawad
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-08-17Merge "Turn on Webview Overlays" into sc-dev am: a43c6c4f2c am: c930224c77Huihong Luo
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15559504 Change-Id: I087691683d73584993b936e744bf8b9c6a4d923c
2021-08-16Merge "Remove Webview Overlays on destroy" into sc-dev am: e44bc77bc3 am: ↵Huihong Luo
dc7594b513 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15546814 Change-Id: I7538b9f56f6f8e759b4894f62eca0f4c7e9ba4b1
2021-08-16Turn on Webview OverlaysHuihong Luo
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-16Add transform matrix to InputWindowHandle.chaviw
Added the transform matrix from WindowInfo native to the Java side InputWindowHandle. This is to allow clients that register a WindowInfoListener to translate the window's screen coordinates to window space. Test: Transform is now sent to WindowInfoListener Bug: 188792659 Change-Id: Ifba8488ff470d3c6c8066e23b871c3d541cff0a1
2021-08-12Remove Webview Overlays on destroyHuihong Luo
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-06CanvasContext::draw: flushAndSubmit when not drawingLeon Scroggins III
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-07-22Switch HWUI to use native performance hint APIBo Liu
Test: None Bug: 194204196 Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
2021-07-16Merge "In VuklanManager make sure we have a valid semaphore context before ↵TreeHugger Robot
destroying it." into sc-dev
2021-07-15Merge "Adjust declared usage for createHardwareBitmapFromRenderNode" into sc-devJohn Reck
2021-07-15In VuklanManager make sure we have a valid semaphore context before ↵Greg Daniel
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-15Adjust declared usage for createHardwareBitmapFromRenderNodeJohn Reck
Fixes: 182901940 Test: make && atest CtsUiRenderingTestCases Change-Id: I0f911463bcf819ef2350e95eaeef099d9edfa866
2021-07-15Merge "Always submit after texture uploads" into sc-devJohn Reck
2021-07-14Always submit after texture uploadsJohn Reck
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-14Avoid sampling outside BQ crop rectJohn Reck
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-11Merge "Properly protect mFrameMetricsReporter" into sc-devTreeHugger Robot
2021-07-09Properly protect mFrameMetricsReporterSiarhei Vishniakou
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-07Reduce number of weakrefs per frameJohn Reck
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-01Disable Webview Overlay when invisibleHuihong Luo
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-01Merge "Make sure we check for valid GrContext when pinning images." into sc-devGreg Daniel
2021-06-30Add a sys prop to control WebView Overlays supportHuihong Luo
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-30Make sure we check for valid GrContext when pinning images.Greg Daniel
Test: manual building and running. Bug: 187540936 Change-Id: Ie900d80128646c8ca2d4fce41d436019e3cf9c71
2021-06-28Reparent surface control for Webview overlayHuihong Luo
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-28Merge "vsyncId should always be incremental" into sc-devTreeHugger Robot
2021-06-28Merge "Linearly complete overscroll stretch when close" into sc-devGeorge Mount
2021-06-25Merge "Revert "Delete RenderProxy off of the cleaner thread"" into sc-devJohn Reck
2021-06-25Revert "Delete RenderProxy off of the cleaner thread"John Reck
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-25Merge "Delete RenderProxy off of the cleaner thread" into sc-devRob Carr
2021-06-24Delete RenderProxy off of the cleaner threadJohn Reck
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-24Fix a crash caused by transactionHuihong Luo
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-23vsyncId should always be incrementalAdy Abraham
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-23Linearly complete overscroll stretch when closeGeorge Mount
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-23Fix: Release skia resources when RenderNode layer is configuredNader Jawad
-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-18Merge "Fix z-order for webview surface control" into sc-devHuihong Luo
2021-06-18Merge "Remove the extra buffer allocation from hwui" into sc-devTreeHugger Robot
2021-06-18Fix z-order for webview surface controlHuihong Luo
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-17Merge "Improve snapshot clearing consistency" into sc-devNader Jawad
2021-06-17Improve snapshot clearing consistencyNader Jawad
Updated snapshot result to clear the internal SkImage whenever the layer changes. The previous logic did not clear out the snapshot in various use cases. Because the implementation before relied on the snapshot created with SkSurface this makes the cleanup logic consistent with SkImages created with SkImage::makeWithFilter Bug: 188450217 Test: manual testing of discord app Change-Id: I6391eb3b49794e54705bf5c6a09d2bdfd0564d05
2021-06-16Fix potential ASurfaceTransactionCallback leaksHuihong Luo
Change the rerferene to java object from global reference to weak reference. Bug: 188555236 Test: check number of ViewRootImpl objects from Systrace Change-Id: I52347b9efb211691826635d046259bc3c54b194f
2021-06-15Remove the extra buffer allocation from hwuiAdy Abraham
SurfaceFlinger will set the maxAcquiredBufferCount on the buffer queue to account for the extra buffers needed, depends on the refresh rate and app/sf durations, and there is no needed for any addional buffer allocation is hwui. Test: TBD Bug: 188553729 Change-Id: Ic441a6feb15f6b084d45c9e538b11b7b24e36a0e
2021-06-15Add logic to clean up resources more frequentlyNader Jawad
Added call to Skia's performDeferredCleanup method to free resources that were not referenced within the last 100 frames or 10 seconds whichever is furthest away Bug: 188450217 Test: manual Change-Id: I3f37e1b5bd01330dbbc2da4a84b1259d56be2768