Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fbd0ad0 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent 50ff5ac8
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -482,6 +482,12 @@ nsecs_t CanvasContext::draw() {


    if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) {
    if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) {
        mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame);
        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
        // Notify the callbacks, even if there's nothing to draw so they aren't waiting
        // indefinitely
        // indefinitely
        waitOnFences();
        waitOnFences();