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

Commit 50a1b358 authored by Alec Mouri's avatar Alec Mouri
Browse files

Let mediaserver use CleanupMode::CLEAN_ALL mode for RenderEngine

This mode for cleanupPostRender:
* Destroys the underlying image cache, so the expicit unbind() call
isn't needed.
* Rebinds texture memory to a placeholder buffer, so the driver won't
keep a buffer around.

Bug: 162202251
Test: Launch custom apk with thumbnail generation
Test: adb shell dumpsys meminfo mediaserver
Change-Id: Idcb008600aab81a46eef4405ad9d52382e5dd810
parent 1326c6d1
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -171,13 +171,7 @@ status_t FrameCaptureProcessor::onCapture(const sp<Layer> &layer,
            err = OK;
        }
    }
    mRE->cleanupPostRender();
    // Unbind the buffer now to remove it from the RenderEngine's image cache.
    // The buffer was put into the image cache during the drawLayers() call above.
    const sp<GraphicBuffer> &gbuf = layerSettings.source.buffer.buffer;
    if (gbuf != nullptr) {
        mRE->unbindExternalTextureBuffer(gbuf->getId());
    }
    mRE->cleanupPostRender(renderengine::RenderEngine::CleanupMode::CLEAN_ALL);
    return err;
}