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

Commit 254972cf authored by John Reck's avatar John Reck
Browse files

Fix HardwareRenderers becoming invalidated by TRIM

Fixes: 335646931
Test: repro steps in bug
Change-Id: I6b22d202b71effa1a7136a20f51b38732d0fde74
parent e234e53b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1010,7 +1010,15 @@ void CanvasContext::destroyHardwareResources() {
}

void CanvasContext::onContextDestroyed() {
    destroyHardwareResources();
    // We don't want to destroyHardwareResources as that will invalidate display lists which
    // the client may not be expecting. Instead just purge all scratch resources
    if (mRenderPipeline->isContextReady()) {
        freePrefetchedLayers();
        for (const sp<RenderNode>& node : mRenderNodes) {
            node->destroyLayers();
        }
        mRenderPipeline->onDestroyHardwareResources();
    }
}

DeferredLayerUpdater* CanvasContext::createTextureLayer() {