Move LayerType to RenderNode

Change-Id: Icb79a5015cb0362b1f3a66d09007450730135a97
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp
index 898e81a..1cb87f2 100644
--- a/libs/hwui/DamageAccumulator.cpp
+++ b/libs/hwui/DamageAccumulator.cpp
@@ -35,6 +35,7 @@
 enum TransformType {
     TransformRenderNode,
     TransformMatrix4,
+    TransformNone,
 };
 
 struct DirtyStack {
@@ -80,14 +81,25 @@
     mHead->matrix4 = transform;
 }
 
+void DamageAccumulator::pushNullTransform() {
+    pushCommon();
+    mHead->type = TransformNone;
+}
+
 void DamageAccumulator::popTransform() {
     LOG_ALWAYS_FATAL_IF(mHead->prev == mHead, "Cannot pop the root frame!");
     DirtyStack* dirtyFrame = mHead;
     mHead = mHead->prev;
-    if (dirtyFrame->type == TransformRenderNode) {
+    switch (dirtyFrame->type) {
+    case TransformRenderNode:
         applyRenderNodeTransform(dirtyFrame);
-    } else {
+        break;
+    case TransformMatrix4:
         applyMatrix4Transform(dirtyFrame);
+        break;
+    case TransformNone:
+        mHead->pendingDirty.join(dirtyFrame->pendingDirty);
+        break;
     }
 }
 
@@ -186,6 +198,10 @@
     mHead->pendingDirty.join(left, top, right, bottom);
 }
 
+void DamageAccumulator::peekAtDirty(SkRect* dest) {
+    *dest = mHead->pendingDirty;
+}
+
 void DamageAccumulator::finish(SkRect* totalDirty) {
     LOG_ALWAYS_FATAL_IF(mHead->prev != mHead, "Cannot finish, mismatched push/pop calls! %p vs. %p", mHead->prev, mHead);
     // Root node never has a transform, so this is the fully mapped dirty rect