From 29781f450d3acc1a1405a83a1a99bad73ed4ff91 Mon Sep 17 00:00:00 2001 From: Minkyoung Kim Date: Tue, 7 Nov 2023 18:35:11 +0900 Subject: Make active Context valid while buildLayer() When RecordingCanvas::drawPoints() is executed through buildLayer(), active Context is null. It leads to crash Change-Id: Iefe7fa0e056e82f07cd54fa3bfd74180f89ae726 --- libs/hwui/renderthread/CanvasContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 504dfaa2a1f5..cedfaed3260a 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -919,6 +919,7 @@ void CanvasContext::buildLayer(RenderNode* node) { // buildLayer() will leave the tree in an unknown state, so we must stop drawing stopDrawing(); + ScopedActiveContext activeContext(this); TreeInfo info(TreeInfo::MODE_FULL, *this); info.damageAccumulator = &mDamageAccumulator; info.layerUpdateQueue = &mLayerUpdateQueue; -- cgit v1.2.3-59-g8ed1b