diff options
author | John Reck <jreck@google.com> | 2017-01-25 10:58:30 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2017-01-25 12:24:40 -0800 |
commit | 2de950d5a8b47c7b4648ada1b1260ce4b7342798 (patch) | |
tree | d374208f819ffd994c51f258b9732b231ba7d9a1 /libs/hwui/pipeline/skia/SkiaDisplayList.cpp | |
parent | df7f28352029766755a4187786db12351ce843c6 (diff) |
Overhaul RenderNode's DisplayList management
* Move mValid to native
* Have destroyHardwareResources destroy everything
* Remove flaky mParentCount checks in setStaging
* All tree updates have an internal observer to
ensure onRemovedFromTree() is a reliable signal
* onRemovedFromTree() immediately releases resources
to avoid displaylist "leaks"
Test: Unit tests for validity added & pass, manually
verified that b/34072929 doesn't repro
Bug: 34072929
Change-Id: I856534b4ed1b7f009fc4b7cd13209b97fa42a71c
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaDisplayList.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaDisplayList.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp index 9db8cd3fe2e2..36d02ecbc8bb 100644 --- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp +++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp @@ -51,8 +51,9 @@ void SkiaDisplayList::updateChildren(std::function<void(RenderNode*)> updateFn) } } -bool SkiaDisplayList::prepareListAndChildren(TreeInfo& info, bool functorsNeedLayer, - std::function<void(RenderNode*, TreeInfo&, bool)> childFn) { +bool SkiaDisplayList::prepareListAndChildren(TreeObserver& observer, TreeInfo& info, + bool functorsNeedLayer, + std::function<void(RenderNode*, TreeObserver&, TreeInfo&, bool)> childFn) { // If the prepare tree is triggered by the UI thread and no previous call to // pinImages has failed then we must pin all mutable images in the GPU cache // until the next UI thread draw. @@ -74,7 +75,7 @@ bool SkiaDisplayList::prepareListAndChildren(TreeInfo& info, bool functorsNeedLa info.damageAccumulator->pushTransform(&mat4); // TODO: a layer is needed if the canvas is rotated or has a non-rect clip info.hasBackwardProjectedNodes = false; - childFn(childNode, info, functorsNeedLayer); + childFn(childNode, observer, info, functorsNeedLayer); hasBackwardProjectedNodesSubtree |= info.hasBackwardProjectedNodes; info.damageAccumulator->popTransform(); } |