New DisplayList v2

First step of many

* Pulls SkLiteDL and SkLiteRecorder into HWUI

* forceDark shifted to be a sync-time transformation
instead of record time. No meaningful behavior change,
but much more flexible heuristics are possible this
way.

Test: build, poked around with forceDark on

Change-Id: I7b7cec5b7fd7c2b18823b4d92d821cf5898f9b88
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index a2e1f60..d5afb20 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -272,6 +272,20 @@
     mStagingDisplayList = nullptr;
     if (mDisplayList) {
         mDisplayList->syncContents();
+        if (CC_UNLIKELY(Properties::forceDarkMode)) {
+            auto usage = usageHint();
+            if (usage == UsageHint::Unknown) {
+                if (mDisplayList->mChildNodes.size() > 1) {
+                    usage = UsageHint::Background;
+                } else if (mDisplayList->mChildNodes.size() == 1 &&
+                           mDisplayList->mChildNodes.front().getRenderNode()->usageHint() !=
+                                   UsageHint::Background) {
+                    usage = UsageHint::Background;
+                }
+            }
+            mDisplayList->mDisplayList.applyColorTransform(
+                    usage == UsageHint::Background ? ColorTransform::Dark : ColorTransform::Light);
+        }
     }
 }