summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.h
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2024-05-31 16:40:17 -0400
committer Leon Scroggins III <scroggo@google.com> 2024-06-04 14:48:58 -0400
commitbac8706b3a053d0f685d319ca0a555af0976d9c8 (patch)
tree0fa601f95ea0dfbeab0e0a1c4c7e49b38bad305e /libs/hwui/Properties.h
parent309fdfc8e9b194e1b8671d2a561db26784468be6 (diff)
Initialize GL even when HWUI is running Vulkan
Even though more and more devices are running Vulkan, many apps still use GL, instead of or in addition to using HWUI. Initialize GL as part of the zygote step. This only happens once at boot - new app processes won't do this again, so it speeds up app startup time. And since it happens before forking the zygote, it starts off in shared memory. If an app never uses GL, it won't have to use any memory for this GL state. Use a new static method on Properties, rather than a static bool, as is done for several other properties, because this happens before loading other properties. Bug: 335172671 Test: manual verification via log statements Flag: initialize_gl_always Change-Id: I80b366121db0034131afb656ea774e37171f223b
Diffstat (limited to 'libs/hwui/Properties.h')
-rw-r--r--libs/hwui/Properties.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index c1510d96461f..d3176f6879d2 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -229,6 +229,11 @@ enum DebugLevel {
#define PROPERTY_8BIT_HDR_HEADROOM "debug.hwui.8bit_hdr_headroom"
+/**
+ * Whether to initialize GL even when HWUI is running Vulkan.
+ */
+#define PROPERTY_INITIALIZE_GL_ALWAYS "debug.hwui.initialize_gl_always"
+
///////////////////////////////////////////////////////////////////////////////
// Misc
///////////////////////////////////////////////////////////////////////////////
@@ -368,6 +373,8 @@ public:
static bool isDrawingEnabled();
static void setDrawingEnabled(bool enable);
+ static bool initializeGlAlways();
+
private:
static StretchEffectBehavior stretchEffectBehavior;
static ProfileType sProfileType;