diff options
author | Leon Scroggins III <scroggo@google.com> | 2021-08-06 13:42:49 -0400 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2021-08-06 13:42:49 -0400 |
commit | 7fbd0ad0f9ce3c365c61be9b34d3b731b6ecc4d1 (patch) | |
tree | ffaf7450a07d0cfd894b24cfc69388ded8689099 /libs/hwui/renderthread/CanvasContext.cpp | |
parent | 50ff5ac8b8a53eda807bcef56bc86b8060fb99df (diff) |
CanvasContext::draw: flushAndSubmit when not drawing
Bug: 195081399
Test: manual + dumpsys gfxinfo
CanvasContext::draw has some conditions under which it will not draw. We
still need to flushAndSubmit to free scratch memory if there were
texture uploads this frame.
Change-Id: I60d230cd36bed310a3155e4f1ca647c99c13c4cd
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 025be7b2b6c1..2f3a509831d1 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -482,6 +482,12 @@ nsecs_t CanvasContext::draw() { if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) { mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); + if (auto grContext = getGrContext()) { + // Submit to ensure that any texture uploads complete and Skia can + // free its staging buffers. + grContext->flushAndSubmit(); + } + // Notify the callbacks, even if there's nothing to draw so they aren't waiting // indefinitely waitOnFences(); |