Implement runtime switch to select default renderer mode

Add a system property debug.hwui.default_renderer, which allows
to set rendering mode to OpenGL (default), Skia OpenGL or Vulkan.

Change-Id: I8bca5bacc5108f77437e340ac61f2d8db8cc4c39
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index cdfc081..880a90e 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -153,6 +153,12 @@
 
 #define PROPERTY_FILTER_TEST_OVERHEAD "debug.hwui.filter_test_overhead"
 
+/**
+ * Allows to set rendering pipeline mode to OpenGL (default), Skia OpenGL
+ * or Vulkan.
+ */
+#define PROPERTY_DEFAULT_RENDERER "debug.hwui.default_renderer"
+
 ///////////////////////////////////////////////////////////////////////////////
 // Runtime configuration properties
 ///////////////////////////////////////////////////////////////////////////////
@@ -245,6 +251,13 @@
     ShowRegion
 };
 
+enum class RenderPipelineType {
+    OpenGL = 0,
+    SkiaGL,
+    Vulkan,
+    NotInitialized = 128
+};
+
 /**
  * Renderthread-only singleton which manages several static rendering properties. Most of these
  * are driven by system properties which are queried once at initialization, and again if init()
@@ -292,6 +305,7 @@
     static int overrideSpotShadowStrength;
 
     static ProfileType getProfileType();
+    static RenderPipelineType getRenderPipelineType();
 
     // Should be used only by test apps
     static bool waitForGpuCompletion;
@@ -304,6 +318,7 @@
 private:
     static ProfileType sProfileType;
     static bool sDisableProfileBars;
+    static RenderPipelineType sRenderPipelineType;
 
 }; // class Caches