summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-07-24 10:36:08 -0700
committerJohn Reck <jreck@google.com>2014-07-24 10:36:08 -0700
commit09d5cddf67b676018700bcc10a72242641cd7eec (patch)
tree92b8ab435be040a30ba9cb2d77246aaaca68e5a1 /libs
parent4f994eb2ddbe68b0eada89dcaae34c079df55c7e (diff)
downloadframeworks_base-09d5cddf67b676018700bcc10a72242641cd7eec.zip
frameworks_base-09d5cddf67b676018700bcc10a72242641cd7eec.tar.gz
frameworks_base-09d5cddf67b676018700bcc10a72242641cd7eec.tar.bz2
Add kModeSync
Bug: 16526750 Change-Id: I4c087160e80432739321172fd57880846c8de6e0
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/DisplayList.cpp3
-rw-r--r--libs/hwui/DisplayList.h2
-rw-r--r--libs/hwui/DisplayListRenderer.cpp2
-rw-r--r--libs/hwui/RenderNode.cpp9
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()) {