Merge "Improve snapshot clearing consistency" into sc-dev

This commit is contained in:
Nader Jawad
2021-06-17 22:32:33 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 2 deletions

View File

@@ -455,8 +455,7 @@ void RenderNode::destroyLayers() {
if (hasLayer()) { if (hasLayer()) {
this->setLayerSurface(nullptr); this->setLayerSurface(nullptr);
} }
mSnapshotResult.snapshot = nullptr;
mTargetImageFilter = nullptr;
if (mDisplayList) { if (mDisplayList) {
mDisplayList.updateChildren([](RenderNode* child) { child->destroyLayers(); }); mDisplayList.updateChildren([](RenderNode* child) { child->destroyLayers(); });
} }

View File

@@ -330,6 +330,11 @@ public:
} else { } else {
mSkiaLayer.reset(); 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;
} }
/** /**