summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.h
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-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-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-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-04-09Remove unecessary exported symbols from libhwui.soDerek Sollenberger
Test: compiles and links Bug: 150782769 Change-Id: Ib49c1bf914b6bfaad1fb29371115df7c9eec08d2
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-04-03Add 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-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-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-12-03Remove ; from closing namespaces in libs/hwuiChris Blume
When closing a namespace a } is sufficient. It doesn't need to be }; like closing a class or enum. Within frameworks/base/libs/hwui there is a mix between } and }; when closing a namespace. There are even mixes between a .h and the corresponding .cpp files. In a separate CL I was asked to not close with };. That was a good comment. I adopted the style from nearby code. This CL cleans up the nearby code. Test: I made sure the code still built as expected. Change-Id: Ieb314a4f48d6e33752463f3be4361fdc9be97482
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-04-18Revert "Add support for render-ahead"John Reck
This reverts commit ec100976e0655acaa204c8800dfb83dadae20cc8. Reason for revert: b/77971494 Test: hwuiunit passes Change-Id: I2e7dc719d2df1dd939b275496c0edc38e458c434
2018-04-10Merge "Remove dead code"TreeHugger Robot
2018-04-09Remove dead codeJohn Reck
Remove an old protobuf serialization experiement, skp capture does this better Test: builds Change-Id: Icd875eabee6b517729f901841e48e579d0e8de4d
2018-04-09Add support for render-aheadJohn Reck
For periods of time during which latency is less important allow a client to request a deeper render-ahead pipeline. The latency tradeoff results in less overall visual jank Test: none, only used by macrobench Change-Id: I516203b70bdc75b6415fa08bf9c4fb1b598b0102
2018-02-26[Magnifier-26] Wire up frame callback for realsiesMihai Popa
Test: none yet Bug: 73810478 Bug: 72041926 Change-Id: I7154ed4b3d2cd820dc8c8ff55eed130be87d1606
2017-11-03Format the world (or just HWUI)John Reck
Test: No code changes, just ran through clang-format Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-10-27Switch to a fancy new queueJohn Reck
Test: unit tests & benchmarks pass/faster Change-Id: I9521432172d6dd6039c5280b1265479a36a86247
2017-08-25Release VectorDrawable cache surface on render threadStan Iliev
Release VectorDrawable cache surface on render thread. This is fixing an assert in skia GrSingleOwner.h:33. Test: Ran gmail before and after the change. Bug: 64842607 Change-Id: I46e0c2557ac5b2fc3be2cc2d35abf96f6d6c9399
2017-07-18Cache VectorDrawables in an atlasStan Iliev
Optimize VectorDrawables for Skia pipeline: draw small VectorDrawables in a GPU atlas instead of seprate offscreen buffers. This implementation is using CacheManger and allows for the atlas to be released if there is a memory pressure. Test: A new unit test for VectorDrawableAtlas is passing. Systrace shows 0.5ms faster DrawFrame for fling in Settings app main screen. Change-Id: Ide3884eefae777e1547f1dfdb67b807185839fb4
2017-06-14Merge "Add a workaround for simulate secondary display" into oc-dev am: ↵John Reck
31443a17e8 am: f0d3971021 Change-Id: I5ee14c0887eaeac267c815851ae6f9e8ee47d80f
2017-06-14Add a workaround for simulate secondary displayJohn Reck
To workaround a deadlock caused by bufferqueue locks we force RenderThread over to use async mode which we enable via eglSwapInterval(0) Bug: 38372997 Test: steps in the bug Change-Id: Ia305f73abbdd64ab0c25d1f7d32792cc6295a0ce
2017-06-02Enable wide color gamut renderingRomain Guy
When wide color gamut rendering is requested, hwui will now use an rgba16f scRGB-nl surface for rendering. This change also fixes the way screenshots are handled in the platform to behave properly with wide gamut rendering. This change does not affect hardware layers. They also need to use rgba16f scRGB-nl; this will be addressed in another CL. Bug: 29940137 Test: CtsUiRenderingTestCases, CtsGraphicsTestCases Change-Id: I68fd96c451652136c566ec48fb0e97c2a7a257c5