diff options
| author | 2014-04-14 20:57:38 +0000 | |
|---|---|---|
| committer | 2014-04-14 20:57:38 +0000 | |
| commit | e8a866d4a41daa43e394505e12503b32c2d929e4 (patch) | |
| tree | 3b2bb5a8a810d91fbba4ea60f5db03c5a1116f6a /libs/hwui/RenderNode.cpp | |
| parent | 6284622cdf949ea213c2e2a0207a90873c2d1d35 (diff) | |
| parent | 860d155f866cc15a725e7ce03763280987f24901 (diff) | |
Merge "Fix issue with bitmap uploading"
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
| -rw-r--r-- | libs/hwui/RenderNode.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index c55ebd6e796b..cf218347ee2a 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -109,7 +109,7 @@ void RenderNode::pushStagingChanges(TreeInfo& info) { mNeedsDisplayListDataSync = false; // Do a push pass on the old tree to handle freeing DisplayListData // that are no longer used - TreeInfo oldTreeInfo = {0}; + TreeInfo oldTreeInfo; prepareSubTree(oldTreeInfo, mDisplayListData); // TODO: The damage for the old tree should be accounted for delete mDisplayListData; @@ -120,8 +120,15 @@ void RenderNode::pushStagingChanges(TreeInfo& info) { void RenderNode::prepareSubTree(TreeInfo& info, DisplayListData* subtree) { if (subtree) { - if (!info.hasFunctors) { - info.hasFunctors = subtree->functorCount; + TextureCache& cache = Caches::getInstance().textureCache; + info.hasFunctors |= subtree->functorCount; + // TODO: Fix ownedBitmapResources to not require disabling prepareTextures + // and thus falling out of async drawing path. + if (subtree->ownedBitmapResources.size()) { + info.prepareTextures = false; + } + for (size_t i = 0; info.prepareTextures && i < subtree->bitmapResources.size(); i++) { + info.prepareTextures = cache.prefetchAndMarkInUse(subtree->bitmapResources[i]); } for (size_t i = 0; i < subtree->children().size(); i++) { RenderNode* childNode = subtree->children()[i]->mDisplayList; |