summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderNode.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2015-07-21 10:23:59 -0700
committer John Reck <jreck@google.com> 2015-07-21 10:46:54 -0700
commit00e79c9947b741194ff6c0d08ede9b3befbf9c9d (patch)
tree26098cf607eaef09a94855aec4ccdd9d8789fd55 /libs/hwui/RenderNode.cpp
parent29cf9aea5490c42b85aaaa98b6784daff82629f8 (diff)
Mark isInUse per-window
Bug: 22509159 Change-Id: I0ae0f1fa582ee38dcb9f24ca20f0b4d0c57ccb32
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r--libs/hwui/RenderNode.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 80f349aa19a2..0951fc158ace 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -214,10 +214,10 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) {
info.renderer->pushLayerUpdate(mLayer);
}
- if (CC_UNLIKELY(info.canvasContext)) {
- // If canvasContext is not null that means there are prefetched layers
- // that need to be accounted for. That might be us, so tell CanvasContext
- // that this layer is in the tree and should not be destroyed.
+ if (info.canvasContext) {
+ // There might be prefetched layers that need to be accounted for.
+ // That might be us, so tell CanvasContext that this layer is in the
+ // tree and should not be destroyed.
info.canvasContext->markLayerInUse(this);
}
}
@@ -339,7 +339,8 @@ void RenderNode::prepareSubTree(TreeInfo& info, bool functorsNeedLayer, DisplayL
TextureCache& cache = Caches::getInstance().textureCache;
info.out.hasFunctors |= subtree->functors.size();
for (size_t i = 0; info.prepareTextures && i < subtree->bitmapResources.size(); i++) {
- info.prepareTextures = cache.prefetchAndMarkInUse(subtree->bitmapResources[i]);
+ info.prepareTextures = cache.prefetchAndMarkInUse(
+ info.canvasContext, subtree->bitmapResources[i]);
}
for (size_t i = 0; i < subtree->children().size(); i++) {
DrawRenderNodeOp* op = subtree->children()[i];