summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
AgeCommit message (Collapse)Author
2022-03-15Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
2021-07-22Switch HWUI to use native performance hint APIBo Liu
Test: None Bug: 194204196 Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
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-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-11Improve picture capture debug pathJohn Reck
* Fixes hardware bitmap capture * Fixes mutable bitmap capture (no flickering) * Adds basic single-frame LRU cache to avoid repeated readbacks of GPU resources * Does up-front readback of GPU resources * Moves serialization off RenderThread again thanks to up-front readback avoiding needing GPU access off-thread * Reduces RAM usage & improves performance by serializing directly to output stream instead of first copying to a byte[] Bug: 174223722 Test: PictureCaptureDemo mirrors the content Change-Id: If7ec208b61d5b917e82087cc312880fc5a38c943
2021-05-22Use TraceUtils.h from gui shared library.rnlee
Test: It makes Bug: 183120308 Change-Id: I331262dd2da59817031f0c708f4c102041dcb5e0
2021-05-12More benchmark tweaksJohn Reck
Bug: 187718492 Test: this Change-Id: Ie0cad91e1c7d1a02704fc4b1007ba2c28cb2b3e7
2021-05-11Macrobenchmark tweaks & gpu memory dumpingJohn Reck
Add support for glob matching Ensure glob matches are alphabetically sorted Add feature to dump GPU memory usage after a test pass Adjust gpu memory dump to be a bit more compact (skip empty outputs) Test: this Bug: 187718492 Change-Id: I6dc80b2d3379d8d10001116e1240727d9914bc10
2021-04-17Webview overlay supportHuihong Luo
The basic idea is to create a child surface control from the root surface control passed from ViewRootImpl to the render thread. Transactions are sent back to the java layer to get merged. In case of offscreen layers, SurfaceControl must be disabled. This new feature is disabled for Vulkan at the moment, a new CL will be used to enable the support. Bug: 173671170 Test: manual, webview apks Change-Id: I119405d13eca3c59fd3ec78e50dc7739f78411d4
2021-04-10Integrate HWUI with PerformanceHintManagerBo Liu
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-02-22Don't double lock when resetting jank testsJorim Jaggi
Fixes: 180875541 Test: adb shell dumpsys com.android.systemui reset Change-Id: Ie656730bbbbb249e6798617cf236b93332e79eb6
2021-02-17Add GPU completion to FrameMetrics (1/3)Jorim Jaggi
- Add SurfaceStatsCallback to TransactionCompletedListener - Register a callback in RenderProxy to be called when we have surface stats from SF via the BLAST callback. - Instead of finishing a frame for frame metrics reporting immediately, wait until BLAST callback fires, note GPU completion time and finish frame. - Expose GPU_COMPLETION in FrameMetrics - Modify TOTAL_DURATION to also include GPU_COMPLETION Test: FrameMetricsListenerTest Fixes: 171046219 Change-Id: I16fa1d80cfc4e7a5527c18fec7e885409f17ee4d
2021-02-16Add SurfaceControl to hwuiHuihong Luo
add a method, setSurfaceControl, for java layer to pass surface control to the render thread Bug: 173671170 Test: call setSurfaceControl method in ViewRootImpl.java Change-Id: I886a79c377938f19cf38b9058f2bec64e1439000
2021-02-08Remove render ahead from hwuiAdy Abraham
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
2020-08-18Fix crash regression when calling setSurface(null)John Reck
Test: HardwareRendererTests#testSetNullSurface Fixes: 165335939 Change-Id: I8f93a0b6a115088af634e21e91b95b4f6a521f12
2020-07-30Wire-up colorMode="hdr"John Reck
Fow now it uses a fixed white point of 150nits TBD if this is disabled or adjusted Test: Demo app Change-Id: Iac13597b3d7633fdef3feaf7ec1da0c27c87904c
2020-06-26Remove legacy callDrawGlFunction2 from HWUIJohn Reck
Bug: 151439970 Test: CtsUiRenderingTestCases passes Change-Id: I1c29df17bb6e8b078467edf73cb3547db6948cdd
2020-02-14[HWUI] Remove references to gui/Surface.Alec Mouri
ANativeWindow usage now has enough feature parity so that we can use that instead. Bug: 137012798 Test: builds Test: Scroll through settings Change-Id: I0054315058b28bcb5e779a6f71a3cfb164625a5f
2020-02-13[HWUI] use ANativeWindow_getLastQueuedBuffer apiAlec Mouri
Bug: 137012798 Test: builds Change-Id: Ic33a21a73b0579726f47c53cc102fb91b5ead0d6
2019-11-21Fix for Surface#lockHardwareCanvas lockupsJohn Reck
By avoiding setting a dequeue buffer timeout we avoid hitting a different path in BufferQueue that prevents async behavior from happening. This restores P's behavior in this path. Bug: 143860379 Test: repro app in bug Change-Id: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
2019-10-04Delete VectorDrawableAtlasJohn Reck
Poking around in a few apps it doesn't appear that the VectorDrawableAtlas is achieving sufficient utilization to justify its existence. The potential for draw call merging doesn't seem warranted for the RAM cost of the atlas. Bug: 137853925 Test: builds Change-Id: Id2419bc6dccb6316636d50c568f8fac75a2d563f
2019-07-16Update includes to begin isolating graphics classes.Derek Sollenberger
GraphicsJNI.h will only be visible to files in the graphics component and this CL begins to remove all usages of that header that are known to be outside the graphic component. Test: compile Bug: 137655431 Change-Id: If310782e5d95d05ab7cbd54dafa5771d315707a7
2019-07-03Rearrange some headersFedor Kudasov
Bug: 117921091 Test: all tests should pass Change-Id: I6ee108df6ec1de8deabfb5ec6b0e8b6e76a940b1
2019-06-27Remove unused (mostly GL-related) headersFedor Kudasov
Bug: 117921091 Test: all tests should pass Change-Id: I419aafd30bfc19f2180eedf924bbd55d5cd36170
2019-06-14Replace CLOCK_MONOTONIC with SYSTEM_TIME_MONOTONICJerome Gaillard
Using SYSTEM_TIME_MONOTONIC works for Android (where it translates to CLOCK_MONOTONIC) and host targets, while CLOCK_MONOTONIC is not defined on macOS. Bug: 117921091 Test: existing tests should pass Change-Id: I1fad472881830fb0701a320cf37319e083932ad4
2019-04-12Support render-ahead in vulkanJohn Reck
Bug: 127822449 Test: verified render_ahead working with skiavk Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-04Add back render-ahead supportJohn Reck
Currently only supported in the EGL path. Vulkan support Coming Soon Bug: 127822449 Test: trace of hwuimacro Change-Id: Iac2b039e11d964aab5b8ca1bdf2a5430b187e2ea
2019-03-29Add missing trace pointsJohn Reck
Test: traced opening recents Change-Id: I51675f1c49f27f1bfa5b18e3d3dd7162e58b1cb8
2019-03-18Remove old TaskManager systemJohn Reck
Replace it with a newer, fancier, WorkQueue-inspired one that's just a global common thread pool. Test: hwuiunit passes Change-Id: Ib5d03104a08bbac9a4ec67a1bfc0db2b35d6700f
2019-02-20Start RenderThread earlier to preload Vulkan/EGL driversStan Iliev
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-01-23Merge "Don't create RenderThread for dumpsys gfxinfo"TreeHugger Robot
2019-01-23Don't create RenderThread for dumpsys gfxinfoJohn Reck
Change-Id: I4cbad14ad6f952ddec11eb732701909fd75ff137 Fixes: 121129527 Test: guess
2019-01-22Add continuous SKP capture test apiJohn Reck
Bug: 122856066 Test: PictureCaptureDemo Change-Id: Iaf3a4bc1c8a2c18c7dff635c5f1cf726b331f8bf
2018-12-14New WebViewFunctor APIJohn Reck
Should function alongside existing functor API. Bug: 120997728 Test: hwuiunit passes Change-Id: I8f6143d0be1111431b55016f34de319f6b8c8910
2018-11-08Refactors and a potential public API for renderingJohn Reck
Split out the View/ViewRootImpl bits from the hardware rendering bits. Create a potential public API surface for hardware rendering Bug: 112709971 Test: builds & boots Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
2018-09-27Wire-up default force-dark based off of isLightThemeJohn Reck
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-20Refactor RenderState and remove unused functionality.Derek Sollenberger
Test: hwui_unit_tests still pass Change-Id: Ie943671535ab8c5da1bac05985e815e0cb842dc1
2018-09-10Refactor HWUI readback code to be backend independentStan Iliev
Implement readback from Surface, TextureView and HW Bitmap for Vulkan pipeline by wrapping the graphics buffer in an SkImage. Refactor both Vulkan and GL readback to use common code. TextureView readback is moved from IRenderPipeline interface to Readback class. Refactor all 3 readback flows to use common implementation. Test: Passed all view, uirendering and graphics CTS tests with GL Test: Passed many CTS test with Vulkan, that require readback Bug: 113673613 Change-Id: Ifbfd8170a5401f87a709b4b1b9fa058e8e11768d
2018-07-18Merge "Move allocateBuffers to RT" into pi-dev am: 2f8a3a4bb8Jorim Jaggi
am: c9756c9193 Change-Id: Ieed40312fe16a54c3e1974621b53e29b23ddcdbc
2018-07-17Move allocateBuffers to RTJorim Jaggi
Such that it gets executed after setSurface, in order that mReqUsage has the correct flags set. Test: Take trace, ensure that allocateBuffers actually allocates in the right format/usage by ensuring that dequeueBuffer doesn't trash them immediately again. Bug: 111517695 Change-Id: I94b402d7b29d565155a77a2d09106246261712d2
2018-05-31Attempting to fix the black flickerJohn Reck
Bug: 79231206 Test: Repro steps from bug Merged-In: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6 Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-31Attempting to fix the black flickerJohn Reck
Bug: 79231206 Test: Repro steps from bug Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-30Remove dead codeJohn Reck
Test: builds Change-Id: I57cf72ca460115463d7759097d5ba598b5ec1775
2018-05-09A better HW Bitmap uploaderJohn Reck
Move all HW bitmap upload operations off of RenderThread. Ensure EGL context outlives all upload requests Bug: 79250950 Test: builds, boots, systrace is good, CTS bitmap tests pass Change-Id: I5ace6c516d33b1afdf1a407cd8b183f6b60c22c1
2018-05-03Delete a bunch of codeJohn Reck
This removes the duality of DisplayList, removing a small amount of overhead Test: buids & hwuiunit passes Change-Id: I8bb3a20e9ead1caec4b4a8a3e9f2c08f717a7096
2018-04-27Move all non-GL HW Bitmap work off RTJohn Reck
Bug: 78288006 Test: hwuiunit passes, systrace showed work distribution as expected, and photos using HW bitmaps still works Change-Id: Id3285b637b5d74d3c5891ed3051ac1e44015987a