summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.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-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-05-22Use TraceUtils.h from gui shared library.rnlee
Test: It makes Bug: 183120308 Change-Id: I331262dd2da59817031f0c708f4c102041dcb5e0
2021-05-08Ignore blocked-on-sf time for ADPFBo Liu
Subtract out time spent blocked in dequeueBuffer. Also subtract out any time UI spents waiting on render thread while render thread is blocked dequeueBuffer, though this calculation is fairly crude. Test: Checked bouncyball returns reasonable-ish numbers even when HWUI is ahead of surface flinger Bug: 187556381 Change-Id: I368c446d93990ff8b7b645e30509405ba799c79c
2021-04-13Change hwui jank detection to use deadline & gpu completion (1/2)Jorim Jaggi
- Use GPU finish time as well as actual deadline to determine jank rate. - Use dynamic interval to adjust for 60/90hz switching - Move frame metrics reporting into JankTracker to adjust the deadline communicated to the app when in stuffing scenario. - Adjust double-stuffing detection to be a bit more readable. Test: GraphicsStatsValidationTest.java Test: adb shell dumpsys gfxinfo Test: FrameMetricsListenerTest Test: Log output of FrameMetricsObserver Bug: 169858044 Change-Id: I3a6b8ed163e2cf9cf2b67667110340ebe35f98a1
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-03-01Trace vsync idAdy Abraham
Add vsync id to the main trace functions. Test: capture a systrace Bug: 170914689 Change-Id: If17394d1bd75bf8139e82c88783e89c00a30a167
2020-10-09pass frame deadline to ChoreographerAdy Abraham
Pass the frame deadline calculated by SF to Choreographer so hwui would be able to improve its stats by knowing if a frame is likely to be late. Bug: 169858174 Test: manual Change-Id: Ib9fd93638b54f08d8dc72fa6b023e2dd7c276dc7
2020-09-16Shared timeline plumbingSteven Thomas
Add plumbing to get shared timeline data from Surface Flinger to HWUI and back. Bug: 162890382 Bug: 162888881 Bug: 162890407 Test: manual using ALOG messages in SF Change-Id: I85c5eb56d2fa933889518854e7b79b1e65e29af3
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
2018-05-31Attempting to fix the black flickerJohn Reck
Bug: 79231206 Test: Repro steps from bug Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-15Apply surface parameters in sync with RenderThreadJorim Jaggi
Otherwise it could lead to parameters applied in the wrong frame, leading to jank. Test: Open notification Bug: 78611607 Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
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-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-09-08Fix flicker from multiwindow resizeJohn Reck
Move content bounds into DrawFrameTask. This ensures that changes in bounds are synchronized with changes in rendering commands, avoiding potential underdraw. Bug: 64200212 Test: Repro steps in bug. Drag up/down on resize handle, verify no flicker. Change-Id: I3109acf262e23c2a7d8904f1dcbfc8273aaed65b
2017-01-25Overhaul RenderNode's DisplayList managementJohn Reck
* Move mValid to native * Have destroyHardwareResources destroy everything * Remove flaky mParentCount checks in setStaging * All tree updates have an internal observer to ensure onRemovedFromTree() is a reliable signal * onRemovedFromTree() immediately releases resources to avoid displaylist "leaks" Test: Unit tests for validity added & pass, manually verified that b/34072929 doesn't repro Bug: 34072929 Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
2016-11-07Refactor pin/unpinImages to work across pipelines.Derek Sollenberger
Test: existing CTS tests still pass Change-Id: Ib2607e9853396bad42f298829b5c5da0d210af32
2016-08-31Wait on frame work fences when frames are droppedChris Craik
bug:30895941 Prevents a race where frame work could interleave between frames, causing SurfaceView position updates to be delivered out of order. Change-Id: I01e4cc557b69dcf33e877a0e16c0d115ec95e4cc
2016-04-18Don't reuse LOST_SURFACE for stoppedJohn Reck
Fixes: 28218991 If a draw() happens while we are stopped, don't report that the surface is lost because this will prompt a tear-down of the surface which isn't desired. It can result in ViewRootImpl ending up in an internally-bad state in this case. Change-Id: If3eb8c6bc8702299e5330bc0917952624dce3b7e
2016-04-14Revert "Revert "Make stopped state a first-class thing""John Reck
This reverts commit eab3f2658aa41d37c3b05d49a2ce4e3f4ed85399. Fixes first-frame issue, mReportNextDraw needs to override mStopped Fixes: 28118961 Fixes: 27286867 Change-Id: I5c811759637d08ba9f3b342016d1b3006986d5a2
2016-04-11Merge "Revert "Make stopped state a first-class thing"" into nyc-devJohn Reck
2016-04-11Revert "Make stopped state a first-class thing"John Reck
This reverts commit 945961f78a78eced823d5ba78505c781b079703d. Change-Id: Iebc1d49fac33380233f8785fc39bec6c30a5e714
2016-04-08Merge "Make stopped state a first-class thing" into nyc-devJohn Reck
2016-04-07Make stopped state a first-class thingJohn Reck
Bug: 27286867 WindowManager has committed to stopped state controlling the lifecycle of the Surface, so make that a first-class thing in HWUI as well. This makes it more resistent to things like a rogue updateSurface() happening while mStopped=true, leading to bad things down the line. Instead let the surface be changed/updated as often as desired, and just block any attempt to draw on that surface. Also removes some unnecessary makeCurrent()s, as EglManager ensures that we *always* have a valid GL context now (using a pbuffer surface if there is no window surface set) Change-Id: Iead78ddebc7997e8fdb0c9534836352f5e54b9bd
2016-04-07Fix some edge casesJohn Reck
Bug: 27709981 This desperately needs a refactor, but to keep the current (really needed & nice) behavior of dispatching after sync finishes would be difficult to handle cleanly without lots of ripping so... #yolo Change-Id: I831a06c6ae7412a062720d68ecbe3085190f0258
2015-12-16Add TextureView support to new renderer/reordererChris Craik
bug:22480459 Change-Id: I2e4c0bc6b904706132f3f5087ededc9cac9b40fb
2015-10-28Simplify TreeInfoChris Craik
Change-Id: I8f05e9046236d607016b6c2bb77a333cfb47ba47
2015-09-21MultiThreaded rendering of different renderNodesSkuhne
This is adding the renderer side infrastructure to allow rendering multiple render nodes with different threads. This is a pre-step for decoupling a non client decor resize reder from a content resize render. Multiple render nodes can be added to be drawn, and to prevent overdrawing, a content bounds area can be set Bug: 22527834 Change-Id: Ie7271e20895bf38957e5a84aeefc883e282039ad
2015-07-21am a2fd3234: am 3bfe4b47: am 1cd5afc1: am 9317d0b9: am 1fddd3ef: Merge "Mark ↵John Reck
isInUse per-window" into mnc-dev * commit 'a2fd32348b06b22963fcc7c33179fddbd2394dbf': Mark isInUse per-window
2015-07-21Mark isInUse per-windowJohn Reck
Bug: 22509159 Change-Id: I0ae0f1fa582ee38dcb9f24ca20f0b4d0c57ccb32
2015-07-14Clean up unncessary definesChris Craik
LOG_TAG and TRACE_TAG are already defined in the makefile Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
2015-07-06Adjust for pipeline stallsJohn Reck
Bug: 20853441 Calculating duration that crosses the UI-RT sync point will now subtract out the time spent waiting in queue under the assumption that this time will be accounted for in the previous frame's metrics Change-Id: Ia8213f4410638840613f5ae439e98dfb77532a6a
2015-06-03Delete MAKE_ENUM_FLAGSChris Craik
bug:21595702 Settle on namespace-enum for consistency. Also removes k prefix. Change-Id: Ib89f94cb9263de40b6e4636577dca4860867d0d8
2015-05-12Unify DrawProfiler/JankStatsJohn Reck
Bug: 20822400 Change-Id: I24345c3120440bfce14e8cbe7e880b39f10b744a
2015-03-11Cleanups & simplificationsJohn Reck
Change-Id: I5ad5e3b8fe55b1528f2e20c63e5abe51d9e40ff1
2015-02-20C++11 style fixupsJohn Reck
Change-Id: I356d02338820bfef41a9e278c88dafc17cfe1cf9
2015-02-20Initial attempt at jank-tracking stat collectionJohn Reck
Is a bit naive, perhaps overly aggressive, but sorta works Change-Id: I01a774e00dbe681439c02557d9728ae43c45ce50
2015-01-05Add overrides and switch to nullptr keyword for all filesChris Craik
Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
2014-11-07Have an actual fallback if the surface is lostJohn Reck
Bug: 17516789 This will force a relayout/reinitialize pass if the Surface is lost mid-render instead of crashing on the next frame Change-Id: If08bfa16f740728fa7c05904fa11e26f07b81e2e
2014-07-25Revert "Dump RenderThread stack on unresponsive"Chris Craik
bug:16563871 bug:16565900 bug:16555847 bug:16551643 This reverts commit ca66e06b9db6e6c921662886e4b7ddd02ac92280. Change-Id: I23e8d4eaf828b1b298126ba5f36e4e8e7451706a
2014-07-23Dump RenderThread stack on unresponsiveJohn Reck
Bug: 16408405 Change-Id: I4ba4836fd1451fb8ba77c34cdb843d3cb4217bb8
2014-06-26Animator refactoring & fixesJohn Reck
Tweaks animators to have less unnecessary refcounting Pull animator management out into seperate class More control to tweak animator lifecycle, such as doing Java-side handling of start delay by attaching but not starting the animator Change-Id: I4ff8207580ca11fb38f45ef0007b406e0097281c
2014-06-23Merge "No-fail invokeFunctor"John Reck
2014-06-23No-fail invokeFunctorJohn Reck
Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
2014-06-23Enable asynchronous RenderThread for WebViewBo Liu
BUG: 12179257 Change-Id: Ib7358dc84a0a58020d178d10b324b9631848c06d