diff options
-rw-r--r-- | libs/hwui/RenderNode.cpp | 3 | ||||
-rw-r--r-- | libs/hwui/RenderNode.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 332f7e6f0eac..44c335f6adb3 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -455,8 +455,7 @@ void RenderNode::destroyLayers() { if (hasLayer()) { this->setLayerSurface(nullptr); } - mSnapshotResult.snapshot = nullptr; - mTargetImageFilter = nullptr; + if (mDisplayList) { mDisplayList.updateChildren([](RenderNode* child) { child->destroyLayers(); }); } diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 8595b6e5f78a..c770150650e2 100644 --- a/libs/hwui/RenderNode.h +++ b/libs/hwui/RenderNode.h @@ -330,6 +330,11 @@ public: } else { mSkiaLayer.reset(); } + + // Clear out the previous snapshot and the image filter the previous + // snapshot was created with whenever the layer changes. + mSnapshotResult.snapshot = nullptr; + mTargetImageFilter = nullptr; } /** |