Refcount RenderNode

Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index 9e6a96d..a5d8dcb 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -29,6 +29,13 @@
 namespace android {
 namespace uirenderer {
 
+DisplayListData::DisplayListData() : projectionReceiveIndex(-1), functorCount(0), hasDrawOps(false) {
+}
+
+DisplayListData::~DisplayListData() {
+    cleanupResources();
+}
+
 void DisplayListData::cleanupResources() {
     Caches& caches = Caches::getInstance();
     caches.unregisterFunctors(functorCount);
@@ -91,5 +98,12 @@
     layers.clear();
 }
 
+void DisplayListData::addChild(DrawDisplayListOp* op) {
+    LOG_ALWAYS_FATAL_IF(!op->renderNode(), "DrawDisplayListOp with no render node!");
+
+    mChildren.push(op);
+    mReferenceHolders.push(op->renderNode());
+}
+
 }; // namespace uirenderer
 }; // namespace android