diff options
author | Bo Liu <boliu@google.com> | 2021-05-06 16:49:40 -0400 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2021-05-08 00:54:41 +0000 |
commit | 4d0f1f1ccefd91fe7ef9316d78d72fb4921cab97 (patch) | |
tree | dbd172e95a88ced352d04cf020959d7644ab2de0 /libs/hwui/renderthread/CanvasContext.cpp | |
parent | 3dd61f2dc967701de7cf441eaf226368cbf5f235 (diff) |
Ignore blocked-on-sf time for ADPF
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
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index bba22071ecef..bae1ab5bab44 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -467,11 +467,11 @@ void CanvasContext::notifyFramePending() { mRenderThread.pushBackFrameCallback(this); } -void CanvasContext::draw() { +nsecs_t CanvasContext::draw() { if (auto grContext = getGrContext()) { if (grContext->abandoned()) { LOG_ALWAYS_FATAL("GrContext is abandoned/device lost at start of CanvasContext::draw"); - return; + return 0; } } SkRect dirty; @@ -486,7 +486,7 @@ void CanvasContext::draw() { std::invoke(func, mFrameNumber); } mFrameCompleteCallbacks.clear(); - return; + return 0; } ScopedActiveContext activeContext(this); @@ -616,6 +616,7 @@ void CanvasContext::draw() { } mRenderThread.cacheManager().onFrameCompleted(); + return mCurrentFrameInfo->get(FrameInfoIndex::DequeueBufferDuration); } void CanvasContext::reportMetricsWithPresentTime() { |