Enable RenderNode and RecordingCanvas for layoutlib

Bug: 117921091
Test: all tests should pass
Change-Id: I574b12a5f7a6a54cbbcb17c35a3884368fd404e6
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index a833f7e..8aee8f5 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -20,7 +20,12 @@
 #include "Debug.h"
 #include "TreeInfo.h"
 #include "VectorDrawable.h"
+#ifdef __ANDROID__
 #include "renderthread/CanvasContext.h"
+#else
+#include "DamageAccumulator.h"
+#include "pipeline/skia/SkiaDisplayList.h"
+#endif
 #include "utils/FatVector.h"
 #include "utils/MathUtils.h"
 #include "utils/StringUtils.h"
@@ -160,6 +165,7 @@
 }
 
 void RenderNode::pushLayerUpdate(TreeInfo& info) {
+#ifdef __ANDROID__ // Layoutlib does not support CanvasContext and Layers
     LayerType layerType = properties().effectiveLayerType();
     // If we are not a layer OR we cannot be rendered (eg, view was detached)
     // we need to destroy any Layers we may have had previously
@@ -188,6 +194,7 @@
     // That might be us, so tell CanvasContext that this layer is in the
     // tree and should not be destroyed.
     info.canvasContext.markLayerInUse(this);
+#endif
 }
 
 /**