From 20f066cace9ff7043643eebf6504d1f1c17868bf Mon Sep 17 00:00:00 2001 From: “Shadman Date: Thu, 12 Dec 2024 19:58:05 +0000 Subject: render thread early preload optimizations 1. preload eglContext when renderthread preload is called so setSurface work is not waiting for this work during app launch crit path. 2. Additionally queue GraphicBufferAllocator instance get, so allocateBuffer does not wait for initialization during app launch critical path. Impact: Large improvement in app launch latency for low core devices - ~70ms of improvement in our view based app launch - ~27ms of improvement in material3 compose base app launch Test: manual built and flashed Bug: 383612849 Flag: early_preload_gl_context Change-Id: I580e31de1d3a9878cf102dfdcad39bfd64bf2c53 --- libs/hwui/Properties.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/hwui/Properties.cpp') diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 064cac2a6fc6..7d01dfbb446f 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -54,6 +54,9 @@ constexpr bool resample_gainmap_regions() { constexpr bool query_global_priority() { return false; } +constexpr bool early_preload_gl_context() { + return false; +} } // namespace hwui_flags #endif @@ -291,5 +294,10 @@ bool Properties::resampleGainmapRegions() { return sResampleGainmapRegions; } +bool Properties::earlyPreloadGlContext() { + return base::GetBoolProperty(PROPERTY_EARLY_PRELOAD_GL_CONTEXT, + hwui_flags::early_preload_gl_context()); +} + } // namespace uirenderer } // namespace android -- cgit v1.2.3-59-g8ed1b