Wrap ViewGroup content in save/restore to protect composited children

bug:15570351

Pos Z composited children are drawn before the primary restore for a
RenderNode. This means that without an additional save/restore (which
wraps the content) they aren't protected from transformations/clips
that happen within the ViewGroup's DisplayList.

Also changes RenderNode to use OpenGLRenderer tag for displaylist
dumping consistency, and simplifies the entry points into RenderNode
drawing, since the distinction between tree root vs tree internal is
no longer important.

Change-Id: I2621eba0592c74d71f85a91a4ab3d0da2d7468d3
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index b2fe849..ec12b9f 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -113,11 +113,8 @@
 
     void computeOrdering();
 
-    void deferNodeTree(DeferStateStruct& deferStruct);
-    void deferNodeInParent(DeferStateStruct& deferStruct, const int level);
-
-    void replayNodeTree(ReplayStateStruct& replayStruct);
-    void replayNodeInParent(ReplayStateStruct& replayStruct, const int level);
+    void defer(DeferStateStruct& deferStruct, const int level);
+    void replay(ReplayStateStruct& replayStruct, const int level);
 
     ANDROID_API void output(uint32_t level = 1);
     ANDROID_API int getDebugSize();
@@ -226,6 +223,14 @@
     inline void issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler);
 
     template <class T>
+    inline int issueOperationsOfNegZChildren(
+            const Vector<ZDrawDisplayListOpPair>& zTranslatedNodes,
+            OpenGLRenderer& renderer, T& handler);
+    template <class T>
+    inline void issueOperationsOfPosZChildren(int shadowRestoreTo,
+            const Vector<ZDrawDisplayListOpPair>& zTranslatedNodes,
+            OpenGLRenderer& renderer, T& handler);
+    template <class T>
     inline void issueOperationsOf3dChildren(const Vector<ZDrawDisplayListOpPair>& zTranslatedNodes,
             ChildrenSelectMode mode, OpenGLRenderer& renderer, T& handler);