diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DisplayList.cpp | 3 | ||||
-rw-r--r-- | libs/hwui/DisplayList.h | 2 | ||||
-rw-r--r-- | libs/hwui/DisplayListRenderer.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/RenderNode.cpp | 9 |
4 files changed, 10 insertions, 6 deletions
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp index e38b532..6461ee7 100644 --- a/libs/hwui/DisplayList.cpp +++ b/libs/hwui/DisplayList.cpp @@ -31,7 +31,6 @@ namespace uirenderer { DisplayListData::DisplayListData() : projectionReceiveIndex(-1) - , functorCount(0) , hasDrawOps(false) { } @@ -41,7 +40,7 @@ DisplayListData::~DisplayListData() { void DisplayListData::cleanupResources() { Caches& caches = Caches::getInstance(); - caches.unregisterFunctors(functorCount); + caches.unregisterFunctors(functors.size()); caches.resourceCache.lock(); for (size_t i = 0; i < bitmapResources.size(); i++) { diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h index bfffbb4..79a2f61 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -126,7 +126,7 @@ public: SortedVector<const SkPath*> sourcePaths; Vector<const SkRegion*> regions; Vector<Layer*> layers; - uint32_t functorCount; + Vector<Functor*> functors; bool hasDrawOps; bool isEmpty() { diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index c7dc29b..5286ef8 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -88,7 +88,7 @@ void DisplayListRenderer::resume() { status_t DisplayListRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) { // Ignore dirty during recording, it matters only when we replay addDrawOp(new (alloc()) DrawFunctorOp(functor)); - mDisplayListData->functorCount++; + mDisplayListData->functors.add(functor); return DrawGlInfo::kStatusDone; // No invalidate needed at record-time } diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 3eb779f..32304dc 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -78,7 +78,7 @@ void RenderNode::setStagingDisplayList(DisplayListData* data) { delete mStagingDisplayListData; mStagingDisplayListData = data; if (mStagingDisplayListData) { - Caches::getInstance().registerFunctors(mStagingDisplayListData->functorCount); + Caches::getInstance().registerFunctors(mStagingDisplayListData->functors.size()); } } @@ -254,6 +254,11 @@ void RenderNode::pushStagingDisplayListChanges(TreeInfo& info) { deleteDisplayListData(); mDisplayListData = mStagingDisplayListData; mStagingDisplayListData = NULL; + if (mDisplayListData) { + for (size_t i = 0; i < mDisplayListData->functors.size(); i++) { + (*mDisplayListData->functors[i])(DrawGlInfo::kModeSync, NULL); + } + } damageSelf(info); } } @@ -271,7 +276,7 @@ void RenderNode::deleteDisplayListData() { void RenderNode::prepareSubTree(TreeInfo& info, DisplayListData* subtree) { if (subtree) { TextureCache& cache = Caches::getInstance().textureCache; - info.out.hasFunctors |= subtree->functorCount; + info.out.hasFunctors |= subtree->functors.size(); // TODO: Fix ownedBitmapResources to not require disabling prepareTextures // and thus falling out of async drawing path. if (subtree->ownedBitmapResources.size()) { |