From 21e7e2d9b13ef1d381b7b0f41f1cac6a947e9bdb Mon Sep 17 00:00:00 2001 From: Jerome Gaillard Date: Tue, 14 May 2019 14:34:46 +0100 Subject: Build native android graphics library for desktop The purpose of this is to be able to use the native graphics code from the Android platform directly in Android Studio (running on desktop) to do layout rendering. This creates a host library that is a subset of libandroid_runtime including only the JNI files relevant to Android graphics. It also includes LayoutlibLoader.cpp which is used to load the JNI when using it as part of layoutlib (the graphics library for Android Studio). This also creates libhwui-host, a host library that is a subset of libhwui. Bug: 117921091 Test: lunch sdk && m libandroid_runtime Change-Id: I3850020d2d4c13c85e377476bc463d3eb6a01c6d --- libs/hwui/Properties.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/hwui/Properties.cpp') diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 2196b0fde90f..1253beb2d2b2 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -17,11 +17,14 @@ #include "Properties.h" #include "Debug.h" #include "DeviceInfo.h" +#ifdef __ANDROID__ #include "HWUIProperties.sysprop.h" +#endif #include "SkTraceEventCommon.h" #include #include +#include #include #include @@ -30,6 +33,16 @@ namespace android { namespace uirenderer { +#ifndef __ANDROID__ // Layoutlib does not compile HWUIProperties.sysprop as it depends on cutils properties +std::optional use_vulkan() { + return base::GetBoolProperty("ro.hwui.use_vulkan", false); +} + +std::optional render_ahead() { + return base::GetIntProperty("ro.hwui.render_ahead", 0); +} +#endif + bool Properties::debugLayersUpdates = false; bool Properties::debugOverdraw = false; bool Properties::showDirtyRegions = false; -- cgit v1.2.3-59-g8ed1b