Rename DisplayListData to DisplayList
Change-Id: I25f6bb88ffdf9baf7e8e4e2a294aa8c9d2a4605b
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index 793d8c0..4eb7066 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -32,16 +32,16 @@
namespace android {
namespace uirenderer {
-DisplayListData::DisplayListData()
+DisplayList::DisplayList()
: projectionReceiveIndex(-1)
, hasDrawOps(false) {
}
-DisplayListData::~DisplayListData() {
+DisplayList::~DisplayList() {
cleanupResources();
}
-void DisplayListData::cleanupResources() {
+void DisplayList::cleanupResources() {
if (CC_UNLIKELY(patchResources.size())) {
ResourceCache& resourceCache = ResourceCache::getInstance();
resourceCache.lock();
@@ -67,7 +67,7 @@
regions.clear();
}
-size_t DisplayListData::addChild(NodeOpType* op) {
+size_t DisplayList::addChild(NodeOpType* op) {
mReferenceHolders.push_back(op->renderNode);
size_t index = mChildren.size();
mChildren.push_back(op);
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index 80ff96a..d32406f 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -112,16 +112,16 @@
/**
* Data structure that holds the list of commands used in display list stream
*/
-class DisplayListData {
+class DisplayList {
friend class DisplayListCanvas;
friend class RecordingCanvas;
public:
struct Chunk {
- // range of included ops in DLD::displayListOps
+ // range of included ops in DisplayList::ops()
size_t beginOpIndex;
size_t endOpIndex;
- // range of included children in DLD::mChildren
+ // range of included children in DisplayList::children()
size_t beginChildIndex;
size_t endChildIndex;
@@ -129,8 +129,8 @@
bool reorderChildren;
};
- DisplayListData();
- ~DisplayListData();
+ DisplayList();
+ ~DisplayList();
// pointers to all ops within display list, pointing into allocator data
std::vector<DisplayListOp*> displayListOps;
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index a1adb80..f49482b 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -34,7 +34,7 @@
DisplayListCanvas::DisplayListCanvas(int width, int height)
: mState(*this)
, mResourceCache(ResourceCache::getInstance())
- , mDisplayListData(nullptr)
+ , mDisplayList(nullptr)
, mTranslateX(0.0f)
, mTranslateY(0.0f)
, mHasDeferredTranslate(false)
@@ -45,14 +45,14 @@
}
DisplayListCanvas::~DisplayListCanvas() {
- LOG_ALWAYS_FATAL_IF(mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(mDisplayList,
"Destroyed a DisplayListCanvas during a record!");
}
void DisplayListCanvas::reset(int width, int height) {
- LOG_ALWAYS_FATAL_IF(mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(mDisplayList,
"prepareDirty called a second time during a recording!");
- mDisplayListData = new DisplayListData();
+ mDisplayList = new DisplayList();
mState.initializeSaveStack(width, height,
0, 0, width, height, Vector3());
@@ -67,26 +67,26 @@
// Operations
///////////////////////////////////////////////////////////////////////////////
-DisplayListData* DisplayListCanvas::finishRecording() {
+DisplayList* DisplayListCanvas::finishRecording() {
flushRestoreToCount();
flushTranslate();
mPaintMap.clear();
mRegionMap.clear();
mPathMap.clear();
- DisplayListData* data = mDisplayListData;
- mDisplayListData = nullptr;
+ DisplayList* displayList = mDisplayList;
+ mDisplayList = nullptr;
mSkiaCanvasProxy.reset(nullptr);
- return data;
+ return displayList;
}
void DisplayListCanvas::callDrawGLFunction(Functor *functor) {
addDrawOp(new (alloc()) DrawFunctorOp(functor));
- mDisplayListData->functors.add(functor);
+ mDisplayList->functors.add(functor);
}
SkCanvas* DisplayListCanvas::asSkCanvas() {
- LOG_ALWAYS_FATAL_IF(!mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(!mDisplayList,
"attempting to get an SkCanvas when we are not recording!");
if (!mSkiaCanvasProxy) {
mSkiaCanvasProxy.reset(new SkiaCanvasProxy(this));
@@ -219,7 +219,7 @@
void DisplayListCanvas::drawLayer(DeferredLayerUpdater* layerHandle) {
// We ref the DeferredLayerUpdater due to its thread-safe ref-counting
// semantics.
- mDisplayListData->ref(layerHandle);
+ mDisplayList->ref(layerHandle);
addDrawOp(new (alloc()) DrawLayerOp(layerHandle->backingLayer()));
}
@@ -354,13 +354,13 @@
CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
CanvasPropertyPaint* paint) {
- mDisplayListData->ref(left);
- mDisplayListData->ref(top);
- mDisplayListData->ref(right);
- mDisplayListData->ref(bottom);
- mDisplayListData->ref(rx);
- mDisplayListData->ref(ry);
- mDisplayListData->ref(paint);
+ mDisplayList->ref(left);
+ mDisplayList->ref(top);
+ mDisplayList->ref(right);
+ mDisplayList->ref(bottom);
+ mDisplayList->ref(rx);
+ mDisplayList->ref(ry);
+ mDisplayList->ref(paint);
refBitmapsInShader(paint->value.getShader());
addDrawOp(new (alloc()) DrawRoundRectPropsOp(&left->value, &top->value,
&right->value, &bottom->value, &rx->value, &ry->value, &paint->value));
@@ -372,10 +372,10 @@
void DisplayListCanvas::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint) {
- mDisplayListData->ref(x);
- mDisplayListData->ref(y);
- mDisplayListData->ref(radius);
- mDisplayListData->ref(paint);
+ mDisplayList->ref(x);
+ mDisplayList->ref(y);
+ mDisplayList->ref(radius);
+ mDisplayList->ref(paint);
refBitmapsInShader(paint->value.getShader());
addDrawOp(new (alloc()) DrawCirclePropsOp(&x->value, &y->value,
&radius->value, &paint->value));
@@ -514,26 +514,26 @@
}
size_t DisplayListCanvas::addOpAndUpdateChunk(DisplayListOp* op) {
- int insertIndex = mDisplayListData->ops.size();
+ int insertIndex = mDisplayList->ops.size();
#if HWUI_NEW_OPS
LOG_ALWAYS_FATAL("unsupported");
#else
- mDisplayListData->ops.push_back(op);
+ mDisplayList->ops.push_back(op);
#endif
if (mDeferredBarrierType != kBarrier_None) {
// op is first in new chunk
- mDisplayListData->chunks.emplace_back();
- DisplayListData::Chunk& newChunk = mDisplayListData->chunks.back();
+ mDisplayList->chunks.emplace_back();
+ DisplayList::Chunk& newChunk = mDisplayList->chunks.back();
newChunk.beginOpIndex = insertIndex;
newChunk.endOpIndex = insertIndex + 1;
newChunk.reorderChildren = (mDeferredBarrierType == kBarrier_OutOfOrder);
- int nextChildIndex = mDisplayListData->children().size();
+ int nextChildIndex = mDisplayList->children().size();
newChunk.beginChildIndex = newChunk.endChildIndex = nextChildIndex;
mDeferredBarrierType = kBarrier_None;
} else {
// standard case - append to existing chunk
- mDisplayListData->chunks.back().endOpIndex = insertIndex + 1;
+ mDisplayList->chunks.back().endOpIndex = insertIndex + 1;
}
return insertIndex;
}
@@ -556,22 +556,22 @@
op->setQuickRejected(rejected);
}
- mDisplayListData->hasDrawOps = true;
+ mDisplayList->hasDrawOps = true;
return flushAndAddOp(op);
}
size_t DisplayListCanvas::addRenderNodeOp(DrawRenderNodeOp* op) {
int opIndex = addDrawOp(op);
#if !HWUI_NEW_OPS
- int childIndex = mDisplayListData->addChild(op);
+ int childIndex = mDisplayList->addChild(op);
// update the chunk's child indices
- DisplayListData::Chunk& chunk = mDisplayListData->chunks.back();
+ DisplayList::Chunk& chunk = mDisplayList->chunks.back();
chunk.endChildIndex = childIndex + 1;
if (op->renderNode->stagingProperties().isProjectionReceiver()) {
// use staging property, since recording on UI thread
- mDisplayListData->projectionReceiveIndex = opIndex;
+ mDisplayList->projectionReceiveIndex = opIndex;
}
#endif
return opIndex;
diff --git a/libs/hwui/DisplayListCanvas.h b/libs/hwui/DisplayListCanvas.h
index 8f4ae3d..fc08504 100644
--- a/libs/hwui/DisplayListCanvas.h
+++ b/libs/hwui/DisplayListCanvas.h
@@ -66,7 +66,7 @@
virtual ~DisplayListCanvas();
void reset(int width, int height);
- __attribute__((warn_unused_result)) DisplayListData* finishRecording();
+ __attribute__((warn_unused_result)) DisplayList* finishRecording();
// ----------------------------------------------------------------------------
// HWUI Canvas state operations
@@ -236,7 +236,7 @@
void flushTranslate();
void flushReorderBarrier();
- LinearAllocator& alloc() { return mDisplayListData->allocator; }
+ LinearAllocator& alloc() { return mDisplayList->allocator; }
// Each method returns final index of op
size_t addOpAndUpdateChunk(DisplayListOp* op);
@@ -253,7 +253,7 @@
inline const T* refBuffer(const T* srcBuffer, int32_t count) {
if (!srcBuffer) return nullptr;
- T* dstBuffer = (T*) mDisplayListData->allocator.alloc(count * sizeof(T));
+ T* dstBuffer = (T*) mDisplayList->allocator.alloc(count * sizeof(T));
memcpy(dstBuffer, srcBuffer, count * sizeof(T));
return dstBuffer;
}
@@ -268,7 +268,7 @@
// The points/verbs within the path are refcounted so this copy operation
// is inexpensive and maintains the generationID of the original path.
const SkPath* cachedPath = new SkPath(*path);
- mDisplayListData->pathResources.push_back(cachedPath);
+ mDisplayList->pathResources.push_back(cachedPath);
return cachedPath;
}
@@ -292,7 +292,7 @@
if (cachedPaint == nullptr || *cachedPaint != *paint) {
cachedPaint = new SkPaint(*paint);
std::unique_ptr<const SkPaint> copy(cachedPaint);
- mDisplayListData->paints.push_back(std::move(copy));
+ mDisplayList->paints.push_back(std::move(copy));
// replaceValueFor() performs an add if the entry doesn't exist
mPaintMap.replaceValueFor(key, cachedPaint);
@@ -312,7 +312,7 @@
if (cachedRegion == nullptr) {
std::unique_ptr<const SkRegion> copy(new SkRegion(*region));
cachedRegion = copy.get();
- mDisplayListData->regions.push_back(std::move(copy));
+ mDisplayList->regions.push_back(std::move(copy));
// replaceValueFor() performs an add if the entry doesn't exist
mRegionMap.replaceValueFor(region, cachedRegion);
@@ -328,12 +328,12 @@
// which doesn't seem worth the extra cycles for this unlikely case.
SkBitmap* localBitmap = new (alloc()) SkBitmap(bitmap);
alloc().autoDestroy(localBitmap);
- mDisplayListData->bitmapResources.push_back(localBitmap);
+ mDisplayList->bitmapResources.push_back(localBitmap);
return localBitmap;
}
inline const Res_png_9patch* refPatch(const Res_png_9patch* patch) {
- mDisplayListData->patchResources.push_back(patch);
+ mDisplayList->patchResources.push_back(patch);
mResourceCache.incrementRefcount(patch);
return patch;
}
@@ -343,7 +343,7 @@
DefaultKeyedVector<const SkRegion*, const SkRegion*> mRegionMap;
ResourceCache& mResourceCache;
- DisplayListData* mDisplayListData;
+ DisplayList* mDisplayList;
float mTranslateX;
float mTranslateY;
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 1f6282d..cb638a4 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -1396,7 +1396,7 @@
class DrawRenderNodeOp : public DrawBoundedOp {
friend class RenderNode; // grant RenderNode access to info of child
- friend class DisplayListData; // grant DisplayListData access to info of child
+ friend class DisplayList; // grant DisplayList access to info of child
friend class DisplayListCanvas;
public:
DrawRenderNodeOp(RenderNode* renderNode, const mat4& transformFromParent, bool clipIsSimple)
diff --git a/libs/hwui/OpReorderer.cpp b/libs/hwui/OpReorderer.cpp
index 2e02306..7c34992 100644
--- a/libs/hwui/OpReorderer.cpp
+++ b/libs/hwui/OpReorderer.cpp
@@ -224,15 +224,15 @@
mCanvasState.save(SkCanvas::kClip_SaveFlag | SkCanvas::kMatrix_SaveFlag);
if (node->applyViewProperties(mCanvasState)) {
// not rejected do ops...
- const DisplayListData& data = node->getDisplayListData();
- deferImpl(data.getChunks(), data.getOps());
+ const DisplayList& displayList = node->getDisplayList();
+ deferImpl(displayList.getChunks(), displayList.getOps());
}
mCanvasState.restore();
}
}
void OpReorderer::defer(int viewportWidth, int viewportHeight,
- const std::vector<DisplayListData::Chunk>& chunks, const std::vector<RecordedOp*>& ops) {
+ const std::vector<DisplayList::Chunk>& chunks, const std::vector<RecordedOp*>& ops) {
ATRACE_NAME("prepare drawing commands");
mCanvasState.initializeSaveStack(viewportWidth, viewportHeight,
0, 0, viewportWidth, viewportHeight, Vector3());
@@ -247,12 +247,12 @@
*/
#define OP_RECIEVER(Type) \
[](OpReorderer& reorderer, const RecordedOp& op) { reorderer.on##Type(static_cast<const Type&>(op)); },
-void OpReorderer::deferImpl(const std::vector<DisplayListData::Chunk>& chunks,
+void OpReorderer::deferImpl(const std::vector<DisplayList::Chunk>& chunks,
const std::vector<RecordedOp*>& ops) {
static std::function<void(OpReorderer& reorderer, const RecordedOp&)> receivers[] = {
MAP_OPS(OP_RECIEVER)
};
- for (const DisplayListData::Chunk& chunk : chunks) {
+ for (const DisplayList::Chunk& chunk : chunks) {
for (size_t opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
const RecordedOp* op = ops[opIndex];
receivers[op->opId](*this, *op);
@@ -288,8 +288,8 @@
// apply RenderProperties state
if (op.renderNode->applyViewProperties(mCanvasState)) {
// not rejected do ops...
- const DisplayListData& data = op.renderNode->getDisplayListData();
- deferImpl(data.getChunks(), data.getOps());
+ const DisplayList& displayList = op.renderNode->getDisplayList();
+ deferImpl(displayList.getChunks(), displayList.getOps());
}
mCanvasState.restore();
}
diff --git a/libs/hwui/OpReorderer.h b/libs/hwui/OpReorderer.h
index 395a1ba..9c77248 100644
--- a/libs/hwui/OpReorderer.h
+++ b/libs/hwui/OpReorderer.h
@@ -63,7 +63,7 @@
const std::vector< sp<RenderNode> >& nodes);
void defer(int viewportWidth, int viewportHeight,
- const std::vector<DisplayListData::Chunk>& chunks, const std::vector<RecordedOp*>& ops);
+ const std::vector<DisplayList::Chunk>& chunks, const std::vector<RecordedOp*>& ops);
typedef std::function<void(void*, const RecordedOp&, const BakedOpState&)> BakedOpReceiver;
/**
@@ -92,7 +92,7 @@
private:
BakedOpState* bakeOpState(const RecordedOp& recordedOp);
- void deferImpl(const std::vector<DisplayListData::Chunk>& chunks,
+ void deferImpl(const std::vector<DisplayList::Chunk>& chunks,
const std::vector<RecordedOp*>& ops);
void replayBakedOpsImpl(void* arg, BakedOpReceiver* receivers);
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index c4debd6..248a46e 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -29,14 +29,14 @@
}
RecordingCanvas::~RecordingCanvas() {
- LOG_ALWAYS_FATAL_IF(mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(mDisplayList,
"Destroyed a RecordingCanvas during a record!");
}
void RecordingCanvas::reset(int width, int height) {
- LOG_ALWAYS_FATAL_IF(mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(mDisplayList,
"prepareDirty called a second time during a recording!");
- mDisplayListData = new DisplayListData();
+ mDisplayList = new DisplayList();
mState.initializeSaveStack(width, height, 0, 0, width, height, Vector3());
@@ -45,18 +45,18 @@
mRestoreSaveCount = -1;
}
-DisplayListData* RecordingCanvas::finishRecording() {
+DisplayList* RecordingCanvas::finishRecording() {
mPaintMap.clear();
mRegionMap.clear();
mPathMap.clear();
- DisplayListData* data = mDisplayListData;
- mDisplayListData = nullptr;
+ DisplayList* displayList = mDisplayList;
+ mDisplayList = nullptr;
mSkiaCanvasProxy.reset(nullptr);
- return data;
+ return displayList;
}
SkCanvas* RecordingCanvas::asSkCanvas() {
- LOG_ALWAYS_FATAL_IF(!mDisplayListData,
+ LOG_ALWAYS_FATAL_IF(!mDisplayList,
"attempting to get an SkCanvas when we are not recording!");
if (!mSkiaCanvasProxy) {
mSkiaCanvasProxy.reset(new SkiaCanvasProxy(this));
@@ -187,7 +187,7 @@
void RecordingCanvas::drawSimpleRects(const float* rects, int vertexCount, const SkPaint* paint) {
if (rects == nullptr) return;
- Vertex* rectData = (Vertex*) mDisplayListData->allocator.alloc(vertexCount * sizeof(Vertex));
+ Vertex* rectData = (Vertex*) mDisplayList->allocator.alloc(vertexCount * sizeof(Vertex));
Vertex* vertex = rectData;
float left = FLT_MAX;
@@ -345,36 +345,36 @@
mState.getRenderTargetClipBounds(),
renderNode);
int opIndex = addOp(op);
- int childIndex = mDisplayListData->addChild(op);
+ int childIndex = mDisplayList->addChild(op);
// update the chunk's child indices
- DisplayListData::Chunk& chunk = mDisplayListData->chunks.back();
+ DisplayList::Chunk& chunk = mDisplayList->chunks.back();
chunk.endChildIndex = childIndex + 1;
if (renderNode->stagingProperties().isProjectionReceiver()) {
// use staging property, since recording on UI thread
- mDisplayListData->projectionReceiveIndex = opIndex;
+ mDisplayList->projectionReceiveIndex = opIndex;
}
}
size_t RecordingCanvas::addOp(RecordedOp* op) {
// TODO: validate if "addDrawOp" quickrejection logic is useful before adding
- int insertIndex = mDisplayListData->ops.size();
- mDisplayListData->ops.push_back(op);
+ int insertIndex = mDisplayList->ops.size();
+ mDisplayList->ops.push_back(op);
if (mDeferredBarrierType != kBarrier_None) {
// op is first in new chunk
- mDisplayListData->chunks.emplace_back();
- DisplayListData::Chunk& newChunk = mDisplayListData->chunks.back();
+ mDisplayList->chunks.emplace_back();
+ DisplayList::Chunk& newChunk = mDisplayList->chunks.back();
newChunk.beginOpIndex = insertIndex;
newChunk.endOpIndex = insertIndex + 1;
newChunk.reorderChildren = (mDeferredBarrierType == kBarrier_OutOfOrder);
- int nextChildIndex = mDisplayListData->children().size();
+ int nextChildIndex = mDisplayList->children().size();
newChunk.beginChildIndex = newChunk.endChildIndex = nextChildIndex;
mDeferredBarrierType = kBarrier_None;
} else {
// standard case - append to existing chunk
- mDisplayListData->chunks.back().endOpIndex = insertIndex + 1;
+ mDisplayList->chunks.back().endOpIndex = insertIndex + 1;
}
return insertIndex;
}
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 8f44ff0..2179e4c 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -41,7 +41,7 @@
virtual ~RecordingCanvas();
void reset(int width, int height);
- __attribute__((warn_unused_result)) DisplayListData* finishRecording();
+ __attribute__((warn_unused_result)) DisplayList* finishRecording();
// ----------------------------------------------------------------------------
// MISC HWUI OPERATIONS - TODO: CATEGORIZE
@@ -187,7 +187,7 @@
// ----------------------------------------------------------------------------
// lazy object copy
// ----------------------------------------------------------------------------
- LinearAllocator& alloc() { return mDisplayListData->allocator; }
+ LinearAllocator& alloc() { return mDisplayList->allocator; }
void refBitmapsInShader(const SkShader* shader);
@@ -195,7 +195,7 @@
inline const T* refBuffer(const T* srcBuffer, int32_t count) {
if (!srcBuffer) return nullptr;
- T* dstBuffer = (T*) mDisplayListData->allocator.alloc(count * sizeof(T));
+ T* dstBuffer = (T*) mDisplayList->allocator.alloc(count * sizeof(T));
memcpy(dstBuffer, srcBuffer, count * sizeof(T));
return dstBuffer;
}
@@ -210,7 +210,7 @@
// The points/verbs within the path are refcounted so this copy operation
// is inexpensive and maintains the generationID of the original path.
const SkPath* cachedPath = new SkPath(*path);
- mDisplayListData->pathResources.push_back(cachedPath);
+ mDisplayList->pathResources.push_back(cachedPath);
return cachedPath;
}
@@ -234,7 +234,7 @@
if (cachedPaint == nullptr || *cachedPaint != *paint) {
cachedPaint = new SkPaint(*paint);
std::unique_ptr<const SkPaint> copy(cachedPaint);
- mDisplayListData->paints.push_back(std::move(copy));
+ mDisplayList->paints.push_back(std::move(copy));
// replaceValueFor() performs an add if the entry doesn't exist
mPaintMap.replaceValueFor(key, cachedPaint);
@@ -254,7 +254,7 @@
if (cachedRegion == nullptr) {
std::unique_ptr<const SkRegion> copy(new SkRegion(*region));
cachedRegion = copy.get();
- mDisplayListData->regions.push_back(std::move(copy));
+ mDisplayList->regions.push_back(std::move(copy));
// replaceValueFor() performs an add if the entry doesn't exist
mRegionMap.replaceValueFor(region, cachedRegion);
@@ -270,12 +270,12 @@
// which doesn't seem worth the extra cycles for this unlikely case.
SkBitmap* localBitmap = new (alloc()) SkBitmap(bitmap);
alloc().autoDestroy(localBitmap);
- mDisplayListData->bitmapResources.push_back(localBitmap);
+ mDisplayList->bitmapResources.push_back(localBitmap);
return localBitmap;
}
inline const Res_png_9patch* refPatch(const Res_png_9patch* patch) {
- mDisplayListData->patchResources.push_back(patch);
+ mDisplayList->patchResources.push_back(patch);
mResourceCache.incrementRefcount(patch);
return patch;
}
@@ -288,7 +288,7 @@
std::unique_ptr<SkiaCanvasProxy> mSkiaCanvasProxy;
ResourceCache& mResourceCache;
DeferredBarrierType mDeferredBarrierType = kBarrier_None;
- DisplayListData* mDisplayListData = nullptr;
+ DisplayList* mDisplayList = nullptr;
bool mHighContrastText = false;
SkAutoTUnref<SkDrawFilter> mDrawFilter;
int mRestoreSaveCount = -1;
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 28586fa..3d32f02 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -48,8 +48,8 @@
prefix, this, getName(), mLayer, mLayer->getFbo(),
mLayer->wasBuildLayered ? "true" : "false");
}
- if (mDisplayListData) {
- for (auto&& child : mDisplayListData->children()) {
+ if (mDisplayList) {
+ for (auto&& child : mDisplayList->children()) {
child->renderNode->debugDumpLayers(prefix);
}
}
@@ -57,17 +57,17 @@
RenderNode::RenderNode()
: mDirtyPropertyFields(0)
- , mNeedsDisplayListDataSync(false)
- , mDisplayListData(nullptr)
- , mStagingDisplayListData(nullptr)
+ , mNeedsDisplayListSync(false)
+ , mDisplayList(nullptr)
+ , mStagingDisplayList(nullptr)
, mAnimatorManager(*this)
, mLayer(nullptr)
, mParentCount(0) {
}
RenderNode::~RenderNode() {
- deleteDisplayListData();
- delete mStagingDisplayListData;
+ deleteDisplayList();
+ delete mStagingDisplayList;
if (mLayer) {
ALOGW("Memory Warning: Layer %p missed its detachment, held on to for far too long!", mLayer);
mLayer->postDecStrong();
@@ -75,10 +75,10 @@
}
}
-void RenderNode::setStagingDisplayList(DisplayListData* data) {
- mNeedsDisplayListDataSync = true;
- delete mStagingDisplayListData;
- mStagingDisplayListData = data;
+void RenderNode::setStagingDisplayList(DisplayList* displayList) {
+ mNeedsDisplayListSync = true;
+ delete mStagingDisplayList;
+ mStagingDisplayList = displayList;
}
/**
@@ -98,12 +98,12 @@
properties().debugOutputProperties(level);
- if (mDisplayListData) {
+ if (mDisplayList) {
#if HWUI_NEW_OPS
LOG_ALWAYS_FATAL("op dumping unsupported");
#else
// TODO: consider printing the chunk boundaries here
- for (auto&& op : mDisplayListData->getOps()) {
+ for (auto&& op : mDisplayList->getOps()) {
op->output(level, DisplayListOp::kOpLogFlag_Recurse);
}
#endif
@@ -177,8 +177,8 @@
}
pnode->clear_children();
- if (mDisplayListData) {
- for (auto&& child : mDisplayListData->children()) {
+ if (mDisplayList) {
+ for (auto&& child : mDisplayList->children()) {
child->renderNode->copyTo(pnode->add_children());
}
}
@@ -186,11 +186,11 @@
int RenderNode::getDebugSize() {
int size = sizeof(RenderNode);
- if (mStagingDisplayListData) {
- size += mStagingDisplayListData->getUsedSize();
+ if (mStagingDisplayList) {
+ size += mStagingDisplayList->getUsedSize();
}
- if (mDisplayListData && mDisplayListData != mStagingDisplayListData) {
- size += mDisplayListData->getUsedSize();
+ if (mDisplayList && mDisplayList != mStagingDisplayList) {
+ size += mDisplayList->getUsedSize();
}
return size;
}
@@ -321,10 +321,10 @@
}
bool willHaveFunctor = false;
- if (info.mode == TreeInfo::MODE_FULL && mStagingDisplayListData) {
- willHaveFunctor = !mStagingDisplayListData->functors.isEmpty();
- } else if (mDisplayListData) {
- willHaveFunctor = !mDisplayListData->functors.isEmpty();
+ if (info.mode == TreeInfo::MODE_FULL && mStagingDisplayList) {
+ willHaveFunctor = !mStagingDisplayList->functors.isEmpty();
+ } else if (mDisplayList) {
+ willHaveFunctor = !mDisplayList->functors.isEmpty();
}
bool childFunctorsNeedLayer = mProperties.prepareForFunctorPresence(
willHaveFunctor, functorsNeedLayer);
@@ -333,7 +333,7 @@
if (info.mode == TreeInfo::MODE_FULL) {
pushStagingDisplayListChanges(info);
}
- prepareSubTree(info, childFunctorsNeedLayer, mDisplayListData);
+ prepareSubTree(info, childFunctorsNeedLayer, mDisplayList);
pushLayerUpdate(info);
info.damageAccumulator->popTransform();
@@ -378,24 +378,24 @@
void RenderNode::syncDisplayList() {
// Make sure we inc first so that we don't fluctuate between 0 and 1,
// which would thrash the layer cache
- if (mStagingDisplayListData) {
- for (auto&& child : mStagingDisplayListData->children()) {
+ if (mStagingDisplayList) {
+ for (auto&& child : mStagingDisplayList->children()) {
child->renderNode->incParentRefCount();
}
}
- deleteDisplayListData();
- mDisplayListData = mStagingDisplayListData;
- mStagingDisplayListData = nullptr;
- if (mDisplayListData) {
- for (size_t i = 0; i < mDisplayListData->functors.size(); i++) {
- (*mDisplayListData->functors[i])(DrawGlInfo::kModeSync, nullptr);
+ deleteDisplayList();
+ mDisplayList = mStagingDisplayList;
+ mStagingDisplayList = nullptr;
+ if (mDisplayList) {
+ for (size_t i = 0; i < mDisplayList->functors.size(); i++) {
+ (*mDisplayList->functors[i])(DrawGlInfo::kModeSync, nullptr);
}
}
}
void RenderNode::pushStagingDisplayListChanges(TreeInfo& info) {
- if (mNeedsDisplayListDataSync) {
- mNeedsDisplayListDataSync = false;
+ if (mNeedsDisplayListSync) {
+ mNeedsDisplayListSync = false;
// Damage with the old display list first then the new one to catch any
// changes in isRenderable or, in the future, bounds
damageSelf(info);
@@ -404,17 +404,17 @@
}
}
-void RenderNode::deleteDisplayListData() {
- if (mDisplayListData) {
- for (auto&& child : mDisplayListData->children()) {
+void RenderNode::deleteDisplayList() {
+ if (mDisplayList) {
+ for (auto&& child : mDisplayList->children()) {
child->renderNode->decParentRefCount();
}
}
- delete mDisplayListData;
- mDisplayListData = nullptr;
+ delete mDisplayList;
+ mDisplayList = nullptr;
}
-void RenderNode::prepareSubTree(TreeInfo& info, bool functorsNeedLayer, DisplayListData* subtree) {
+void RenderNode::prepareSubTree(TreeInfo& info, bool functorsNeedLayer, DisplayList* subtree) {
if (subtree) {
TextureCache& cache = Caches::getInstance().textureCache;
info.out.hasFunctors |= subtree->functors.size();
@@ -444,14 +444,14 @@
LayerRenderer::destroyLayer(mLayer);
mLayer = nullptr;
}
- if (mDisplayListData) {
- for (auto&& child : mDisplayListData->children()) {
+ if (mDisplayList) {
+ for (auto&& child : mDisplayList->children()) {
child->renderNode->destroyHardwareResources();
}
- if (mNeedsDisplayListDataSync) {
+ if (mNeedsDisplayListSync) {
// Next prepare tree we are going to push a new display list, so we can
// drop our current one now
- deleteDisplayListData();
+ deleteDisplayList();
}
}
}
@@ -633,9 +633,9 @@
// TODO: create temporary DDLOp and call computeOrderingImpl on top DisplayList so that
// transform properties are applied correctly to top level children
- if (mDisplayListData == nullptr) return;
- for (unsigned int i = 0; i < mDisplayListData->children().size(); i++) {
- DrawRenderNodeOp* childOp = mDisplayListData->children()[i];
+ if (mDisplayList == nullptr) return;
+ for (unsigned int i = 0; i < mDisplayList->children().size(); i++) {
+ DrawRenderNodeOp* childOp = mDisplayList->children()[i];
childOp->renderNode->computeOrderingImpl(childOp, &mProjectedNodes, &mat4::identity());
}
#endif
@@ -647,7 +647,7 @@
const mat4* transformFromProjectionSurface) {
#if !HWUI_NEW_OPS
mProjectedNodes.clear();
- if (mDisplayListData == nullptr || mDisplayListData->isEmpty()) return;
+ if (mDisplayList == nullptr || mDisplayList->isEmpty()) return;
// TODO: should avoid this calculation in most cases
// TODO: just calculate single matrix, down to all leaf composited elements
@@ -664,11 +664,11 @@
opState->mSkipInOrderDraw = false;
}
- if (mDisplayListData->children().size() > 0) {
- const bool isProjectionReceiver = mDisplayListData->projectionReceiveIndex >= 0;
+ if (mDisplayList->children().size() > 0) {
+ const bool isProjectionReceiver = mDisplayList->projectionReceiveIndex >= 0;
bool haveAppliedPropertiesToProjection = false;
- for (unsigned int i = 0; i < mDisplayListData->children().size(); i++) {
- DrawRenderNodeOp* childOp = mDisplayListData->children()[i];
+ for (unsigned int i = 0; i < mDisplayList->children().size(); i++) {
+ DrawRenderNodeOp* childOp = mDisplayList->children()[i];
RenderNode* child = childOp->renderNode;
std::vector<DrawRenderNodeOp*>* projectionChildren = nullptr;
@@ -750,13 +750,13 @@
issueOperations<ReplayOperationHandler>(replayStruct.mRenderer, handler);
}
-void RenderNode::buildZSortedChildList(const DisplayListData::Chunk& chunk,
+void RenderNode::buildZSortedChildList(const DisplayList::Chunk& chunk,
std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes) {
#if !HWUI_NEW_OPS
if (chunk.beginChildIndex == chunk.endChildIndex) return;
for (unsigned int i = chunk.beginChildIndex; i < chunk.endChildIndex; i++) {
- DrawRenderNodeOp* childOp = mDisplayListData->children()[i];
+ DrawRenderNodeOp* childOp = mDisplayList->children()[i];
RenderNode* child = childOp->renderNode;
float childZ = child->properties().getZ();
@@ -924,7 +924,7 @@
nullptr;
LOG_ALWAYS_FATAL("unsupported");
#else
- (mDisplayListData->getOps()[mDisplayListData->projectionReceiveIndex]);
+ (mDisplayList->getOps()[mDisplayList->projectionReceiveIndex]);
#endif
const DrawRenderNodeOp* backgroundOp = reinterpret_cast<const DrawRenderNodeOp*>(op);
const RenderProperties& backgroundProps = backgroundOp->renderNode->properties();
@@ -962,7 +962,7 @@
*/
template <class T>
void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
- if (mDisplayListData->isEmpty()) {
+ if (mDisplayList->isEmpty()) {
DISPLAY_LIST_LOGD("%*sEmpty display list (%p, %s)", handler.level() * 2, "",
this, getName());
return;
@@ -1020,9 +1020,9 @@
renderer.getSaveCount() - 1, properties().getClipToBounds());
} else {
const int saveCountOffset = renderer.getSaveCount() - 1;
- const int projectionReceiveIndex = mDisplayListData->projectionReceiveIndex;
- for (size_t chunkIndex = 0; chunkIndex < mDisplayListData->getChunks().size(); chunkIndex++) {
- const DisplayListData::Chunk& chunk = mDisplayListData->getChunks()[chunkIndex];
+ const int projectionReceiveIndex = mDisplayList->projectionReceiveIndex;
+ for (size_t chunkIndex = 0; chunkIndex < mDisplayList->getChunks().size(); chunkIndex++) {
+ const DisplayList::Chunk& chunk = mDisplayList->getChunks()[chunkIndex];
std::vector<ZDrawRenderNodeOpPair> zTranslatedNodes;
buildZSortedChildList(chunk, zTranslatedNodes);
@@ -1031,7 +1031,7 @@
initialTransform, zTranslatedNodes, renderer, handler);
for (size_t opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
- DisplayListOp *op = mDisplayListData->getOps()[opIndex];
+ DisplayListOp *op = mDisplayList->getOps()[opIndex];
#if DEBUG_DISPLAY_LIST
op->output(handler.level() + 1);
#endif
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index ff673ba..57e41c6 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -66,12 +66,12 @@
* Primary class for storing recorded canvas commands, as well as per-View/ViewGroup display properties.
*
* Recording of canvas commands is somewhat similar to SkPicture, except the canvas-recording
- * functionality is split between DisplayListCanvas (which manages the recording), DisplayListData
+ * functionality is split between DisplayListCanvas (which manages the recording), DisplayList
* (which holds the actual data), and DisplayList (which holds properties and performs playback onto
* a renderer).
*
- * Note that DisplayListData is swapped out from beneath an individual DisplayList when a view's
- * recorded stream of canvas operations is refreshed. The DisplayList (and its properties) stay
+ * Note that DisplayList is swapped out from beneath an individual RenderNode when a view's
+ * recorded stream of canvas operations is refreshed. The RenderNode (and its properties) stay
* attached.
*/
class RenderNode : public VirtualLightRefBase {
@@ -104,7 +104,7 @@
void debugDumpLayers(const char* prefix);
- ANDROID_API void setStagingDisplayList(DisplayListData* newData);
+ ANDROID_API void setStagingDisplayList(DisplayList* newData);
void computeOrdering();
@@ -116,11 +116,11 @@
void copyTo(proto::RenderNode* node);
bool isRenderable() const {
- return mDisplayListData && !mDisplayListData->isEmpty();
+ return mDisplayList && !mDisplayList->isEmpty();
}
bool hasProjectionReceiver() const {
- return mDisplayListData && mDisplayListData->projectionReceiveIndex >= 0;
+ return mDisplayList && mDisplayList->projectionReceiveIndex >= 0;
}
const char* getName() const {
@@ -185,16 +185,16 @@
bool nothingToDraw() const {
const Outline& outline = properties().getOutline();
- return mDisplayListData == nullptr
+ return mDisplayList == nullptr
|| properties().getAlpha() <= 0
|| (outline.getShouldClip() && outline.isEmpty())
|| properties().getScaleX() == 0
|| properties().getScaleY() == 0;
}
- // Only call if RenderNode has DisplayListData...
- const DisplayListData& getDisplayListData() const {
- return *mDisplayListData;
+ // Only call if RenderNode has DisplayList...
+ const DisplayList& getDisplayList() const {
+ return *mDisplayList;
}
private:
@@ -219,7 +219,7 @@
template <class T>
inline void setViewProperties(OpenGLRenderer& renderer, T& handler);
- void buildZSortedChildList(const DisplayListData::Chunk& chunk,
+ void buildZSortedChildList(const DisplayList::Chunk& chunk,
std::vector<ZDrawRenderNodeOpPair>& zTranslatedNodes);
template<class T>
@@ -261,11 +261,11 @@
void prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer);
void pushStagingPropertiesChanges(TreeInfo& info);
void pushStagingDisplayListChanges(TreeInfo& info);
- void prepareSubTree(TreeInfo& info, bool functorsNeedLayer, DisplayListData* subtree);
+ void prepareSubTree(TreeInfo& info, bool functorsNeedLayer, DisplayList* subtree);
void applyLayerPropertiesToLayer(TreeInfo& info);
void prepareLayer(TreeInfo& info, uint32_t dirtyMask);
void pushLayerUpdate(TreeInfo& info);
- void deleteDisplayListData();
+ void deleteDisplayList();
void damageSelf(TreeInfo& info);
void incParentRefCount() { mParentCount++; }
@@ -277,10 +277,10 @@
RenderProperties mProperties;
RenderProperties mStagingProperties;
- bool mNeedsDisplayListDataSync;
- // WARNING: Do not delete this directly, you must go through deleteDisplayListData()!
- DisplayListData* mDisplayListData;
- DisplayListData* mStagingDisplayListData;
+ bool mNeedsDisplayListSync;
+ // WARNING: Do not delete this directly, you must go through deleteDisplayList()!
+ DisplayList* mDisplayList;
+ DisplayList* mStagingDisplayList;
friend class AnimatorManager;
AnimatorManager mAnimatorManager;
@@ -301,7 +301,7 @@
// When this hits 0 we are no longer in the tree, so any hardware resources
// (specifically Layers) should be released.
// This is *NOT* thread-safe, and should therefore only be tracking
- // mDisplayListData, not mStagingDisplayListData.
+ // mDisplayList, not mStagingDisplayList.
uint32_t mParentCount;
}; // class RenderNode
diff --git a/libs/hwui/microbench/DisplayListCanvasBench.cpp b/libs/hwui/microbench/DisplayListCanvasBench.cpp
index dccbe0b..0be7634 100644
--- a/libs/hwui/microbench/DisplayListCanvasBench.cpp
+++ b/libs/hwui/microbench/DisplayListCanvasBench.cpp
@@ -33,24 +33,24 @@
typedef DisplayListCanvas TestCanvas;
#endif
-BENCHMARK_NO_ARG(BM_DisplayListData_alloc);
-void BM_DisplayListData_alloc::Run(int iters) {
+BENCHMARK_NO_ARG(BM_DisplayList_alloc);
+void BM_DisplayList_alloc::Run(int iters) {
StartBenchmarkTiming();
for (int i = 0; i < iters; ++i) {
- auto data = new DisplayListData();
- MicroBench::DoNotOptimize(data);
- delete data;
+ auto displayList = new DisplayList();
+ MicroBench::DoNotOptimize(displayList);
+ delete displayList;
}
StopBenchmarkTiming();
}
-BENCHMARK_NO_ARG(BM_DisplayListData_alloc_theoretical);
-void BM_DisplayListData_alloc_theoretical::Run(int iters) {
+BENCHMARK_NO_ARG(BM_DisplayList_alloc_theoretical);
+void BM_DisplayList_alloc_theoretical::Run(int iters) {
StartBenchmarkTiming();
for (int i = 0; i < iters; ++i) {
- auto data = new char[sizeof(DisplayListData)];
- MicroBench::DoNotOptimize(data);
- delete[] data;
+ auto displayList = new char[sizeof(DisplayList)];
+ MicroBench::DoNotOptimize(displayList);
+ delete[] displayList;
}
StopBenchmarkTiming();
}
diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h
index 68ee897..cae251a9 100644
--- a/libs/hwui/renderthread/DrawFrameTask.h
+++ b/libs/hwui/renderthread/DrawFrameTask.h
@@ -32,7 +32,7 @@
namespace uirenderer {
class DeferredLayerUpdater;
-class DisplayListData;
+class DisplayList;
class RenderNode;
namespace renderthread {
@@ -48,7 +48,7 @@
/*
* This is a special Super Task. It is re-used multiple times by RenderProxy,
- * and contains state (such as layer updaters & new DisplayListDatas) that is
+ * and contains state (such as layer updaters & new DisplayLists) that is
* tracked across many frames not just a single frame.
* It is the sync-state task, and will kick off the post-sync draw
*/
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index d1b62f1..338fab6 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -38,7 +38,7 @@
class DeferredLayerUpdater;
class RenderNode;
-class DisplayListData;
+class DisplayList;
class Layer;
class Rect;
diff --git a/libs/hwui/unit_tests/OpReordererTests.cpp b/libs/hwui/unit_tests/OpReordererTests.cpp
index cbfbb23..24cff72 100644
--- a/libs/hwui/unit_tests/OpReordererTests.cpp
+++ b/libs/hwui/unit_tests/OpReordererTests.cpp
@@ -49,7 +49,7 @@
static void endFrame(Info& info) {}
};
TEST(OpReorderer, simple) {
- auto dld = TestUtils::createDLD<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
+ auto dld = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
SkBitmap bitmap = TestUtils::createSkBitmap(25, 25);
canvas.drawRect(0, 0, 100, 200, SkPaint());
canvas.drawBitmap(bitmap, 10, 10, nullptr);
@@ -78,7 +78,7 @@
static void endFrame(Info& info) {}
};
TEST(OpReorderer, simpleBatching) {
- auto dld = TestUtils::createDLD<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
+ auto dld = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
SkBitmap bitmap = TestUtils::createSkBitmap(10, 10);
// Alternate between drawing rects and bitmaps, with bitmaps overlapping rects.
diff --git a/libs/hwui/unit_tests/RecordingCanvasTests.cpp b/libs/hwui/unit_tests/RecordingCanvasTests.cpp
index c813833..7c19df5 100644
--- a/libs/hwui/unit_tests/RecordingCanvasTests.cpp
+++ b/libs/hwui/unit_tests/RecordingCanvasTests.cpp
@@ -23,9 +23,9 @@
namespace android {
namespace uirenderer {
-static void playbackOps(const std::vector<DisplayListData::Chunk>& chunks,
+static void playbackOps(const std::vector<DisplayList::Chunk>& chunks,
const std::vector<RecordedOp*>& ops, std::function<void(const RecordedOp&)> opReciever) {
- for (const DisplayListData::Chunk& chunk : chunks) {
+ for (const DisplayList::Chunk& chunk : chunks) {
for (size_t opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
opReciever(*ops[opIndex]);
}
@@ -33,7 +33,7 @@
}
TEST(RecordingCanvas, emptyPlayback) {
- auto dld = TestUtils::createDLD<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
+ auto dld = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
canvas.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
canvas.restore();
});
@@ -41,7 +41,7 @@
}
TEST(RecordingCanvas, testSimpleRectRecord) {
- auto dld = TestUtils::createDLD<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
+ auto dld = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
canvas.drawRect(10, 20, 90, 180, SkPaint());
});
@@ -56,7 +56,7 @@
}
TEST(RecordingCanvas, backgroundAndImage) {
- auto dld = TestUtils::createDLD<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
+ auto dld = TestUtils::createDisplayList<RecordingCanvas>(100, 200, [](RecordingCanvas& canvas) {
SkBitmap bitmap;
bitmap.setInfo(SkImageInfo::MakeUnknown(25, 25));
SkPaint paint;
diff --git a/libs/hwui/unit_tests/TestUtils.h b/libs/hwui/unit_tests/TestUtils.h
index 9b7d1b9..bb58928 100644
--- a/libs/hwui/unit_tests/TestUtils.h
+++ b/libs/hwui/unit_tests/TestUtils.h
@@ -53,11 +53,11 @@
}
template<class CanvasType>
- static std::unique_ptr<DisplayListData> createDLD(int width, int height,
+ static std::unique_ptr<DisplayList> createDisplayList(int width, int height,
std::function<void(CanvasType& canvas)> canvasCallback) {
CanvasType canvas(width, height);
canvasCallback(canvas);
- return std::unique_ptr<DisplayListData>(canvas.finishRecording());
+ return std::unique_ptr<DisplayList>(canvas.finishRecording());
}
template<class CanvasType>