diff options
author | 2018-12-17 22:26:25 +0000 | |
---|---|---|
committer | 2018-12-17 22:26:25 +0000 | |
commit | 73d3d815cd5e7613735d429be7f1398a9053b9f1 (patch) | |
tree | 5660ea4714f2d84992e4e8df1b8f2c4e9f2d7c7f | |
parent | 009bd1bfe357418d993a93f3b28adb56d8ea01e5 (diff) | |
parent | b8811aa52ff81a3de253320e2005d0690bb9ba64 (diff) |
Merge "Read product property to set Vulkan as default render pipeline"
-rw-r--r-- | libs/hwui/Android.bp | 1 | ||||
-rw-r--r-- | libs/hwui/HWUIProperties.sysprop | 9 | ||||
-rw-r--r-- | libs/hwui/Properties.cpp | 8 |
3 files changed, 17 insertions, 1 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index 0503f36ec074..6585bfc929ba 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -208,6 +208,7 @@ cc_defaults { "FrameInfoVisualizer.cpp", "GpuMemoryTracker.cpp", "HardwareBitmapUploader.cpp", + "HWUIProperties.sysprop", "Interpolator.cpp", "JankTracker.cpp", "Layer.cpp", diff --git a/libs/hwui/HWUIProperties.sysprop b/libs/hwui/HWUIProperties.sysprop new file mode 100644 index 000000000000..42191ca6f514 --- /dev/null +++ b/libs/hwui/HWUIProperties.sysprop @@ -0,0 +1,9 @@ +owner: Platform +module: "android.uirenderer" +prop { + api_name: "use_vulkan" + type: Boolean + prop_name: "ro.hwui.use_vulkan" + scope: Public + access: Readonly +} diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 8067313b2cb2..046ffc4da5ea 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -18,6 +18,7 @@ #include "Debug.h" #include "DeviceInfo.h" #include "SkTraceEventCommon.h" +#include "HWUIProperties.sysprop.h" #include <algorithm> #include <cstdlib> @@ -174,8 +175,13 @@ RenderPipelineType Properties::getRenderPipelineType() { if (sRenderPipelineType != RenderPipelineType::NotInitialized) { return sRenderPipelineType; } + bool useVulkan = use_vulkan().value_or(false); char prop[PROPERTY_VALUE_MAX]; - property_get(PROPERTY_RENDERER, prop, "skiagl"); + if (useVulkan) { + property_get(PROPERTY_RENDERER, prop, "skiavk"); + } else { + property_get(PROPERTY_RENDERER, prop, "skiagl"); + } if (!strcmp(prop, "skiavk")) { ALOGD("Skia Vulkan Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaVulkan; |