diff options
author | John Reck <jreck@google.com> | 2014-06-30 16:20:04 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-06-30 16:36:26 -0700 |
commit | f47a594f5250b1914c36423ee6b371f0b8db09d0 (patch) | |
tree | f86289c7b515c2111fde3ce11e7fca384bc2f603 /libs/hwui/RenderNode.cpp | |
parent | dd59aba6c7e142eae14d5f29ea6873a5b9790174 (diff) | |
download | frameworks_base-f47a594f5250b1914c36423ee6b371f0b8db09d0.zip frameworks_base-f47a594f5250b1914c36423ee6b371f0b8db09d0.tar.gz frameworks_base-f47a594f5250b1914c36423ee6b371f0b8db09d0.tar.bz2 |
Fix onTrimMemory for HardwareRenderer
Also fixes detachFunctor possibly drawing after return
Bug: 15189843
Bug: 15990672
Change-Id: I64c48cb674c461a8eeaba407b697e09f72c98ce3
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r-- | libs/hwui/RenderNode.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index e803ec3..89105ea 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -195,17 +195,28 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) { void RenderNode::prepareTreeImpl(TreeInfo& info) { info.damageAccumulator->pushTransform(this); - if (info.mode == TreeInfo::MODE_FULL) { + + switch (info.mode) { + case TreeInfo::MODE_FULL: pushStagingPropertiesChanges(info); mAnimatorManager.animate(info); - } else if (info.mode == TreeInfo::MODE_MAYBE_DETACHING) { + break; + case TreeInfo::MODE_MAYBE_DETACHING: pushStagingPropertiesChanges(info); - } else if (info.mode == TreeInfo::MODE_RT_ONLY) { + break; + case TreeInfo::MODE_RT_ONLY: mAnimatorManager.animate(info); + break; + case TreeInfo::MODE_DESTROY_RESOURCES: + // This will also release the hardware layer if we have one as + // isRenderable() will return false, thus causing pushLayerUpdate + // to recycle the hardware layer + setStagingDisplayList(NULL); + break; } prepareLayer(info); - if (info.mode == TreeInfo::MODE_FULL) { + if (info.mode == TreeInfo::MODE_FULL || info.mode == TreeInfo::MODE_DESTROY_RESOURCES) { pushStagingDisplayListChanges(info); } prepareSubTree(info, mDisplayListData); |