summaryrefslogtreecommitdiff
path: root/opengl/libagl/BufferObjectManager.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2019-03-19 18:42:03 -0700
committer Alec Mouri <alecmouri@google.com> 2019-03-21 18:42:52 -0700
commit6db6d622ee87746c38116d5f53afede9226bdd30 (patch)
treea0baed706ce69eb9f8380f33291a1cc880019f65 /opengl/libagl/BufferObjectManager.cpp
parent5e1371af16bab6714fd11dfdbfe1b573a6e8d088 (diff)
When adding event listener, use fuzzy window for last event time.
* We track the last callback time anyways, so there's no risk of double-firing * Without this we might risk missing a dispsync event. E.g., if vsyncs are at T and T+11, and we're considering SF events with +1 offset, then SF will fire at T+1. If we immediately deregister the SF listener, then re-register later at T+13, we miss the event at T+12. But we would probably be ok to fire at T+13 anyways. Note that the old last event time inference did allow for this. See change I742b30a8d28780a44592c4d3077f33d23cf65789... listener.mLastEventTime = systemTime() - mPeriod / 2 + mPhase - mWakeupLatency; ...with +2/+6 offsets and 16.6ms period, then if SF registers at +7ms after vsync, then last event time is inferred to be T-1.3ms, and with reference time T-16.6ms, then the next computed event time ends up being (floor(((T-1.3) - (T-16.6) - 6)/16.6) + 1)* 16.6 + 6 + T-16.6, which ends up being T+6ms, which would immediately cause a wakeup. So this change reintroduces that behavior while keeping the math right. Bug: 128918820 Test: systrace Change-Id: If45be5a579628045ba3d9bfe282bf8831fdb5275
Diffstat (limited to 'opengl/libagl/BufferObjectManager.cpp')
0 files changed, 0 insertions, 0 deletions