summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author “Shadman <shadmans@google.com> 2025-01-07 20:01:13 +0000
committer “Shadman <shadmans@google.com> 2025-01-14 01:10:41 +0000
commit5f66a5be316b230c43d66f57f87899588dec8c06 (patch)
tree947cb691f470baa1c188cb39958acc5cf4cdfc51
parent2632c401eb79c22375e88140ec60dc1ff9121b32 (diff)
Only preload egl context
- The buffer allocator initialization is removed from this flag as it is caused a memory regression b/384876428 on activities without ui. - This change allows us to claw back some of the improvement and we can follow up with further optimizations afterwards impact: improves app launch latency in low core devices - ~20ms in our view baed app launch - up to ~60ms improvements in material3 compose app - net neutral memory change Test: build and app launch test Bug: 383612849 Flag: com.android.graphics.hwui.flags.early_preload_gl_context Change-Id: I3009dcf7f9ec86e908cd65239974be208ad6b918
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 69fe40c755ea..6ab8e4e0e2ab 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -323,6 +323,7 @@ void RenderThread::initGrContextOptions(GrContextOptions& options) {
}
void RenderThread::destroyRenderingContext() {
+ ATRACE_CALL();
mFunctorManager.onContextDestroyed();
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
if (mEglManager->hasEglContext()) {
@@ -520,7 +521,10 @@ void RenderThread::preload() {
// EGL driver is always preloaded only if HWUI renders with GL.
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
if (Properties::earlyPreloadGlContext()) {
- queue().post([this]() { requireGlContext(); });
+ queue().post([this]() {
+ ATRACE_NAME("earlyPreloadGlContext");
+ requireGlContext();
+ });
} else {
std::thread eglInitThread([]() { eglGetDisplay(EGL_DEFAULT_DISPLAY); });
eglInitThread.detach();
@@ -528,9 +532,6 @@ void RenderThread::preload() {
} else {
requireVkContext();
}
- if (Properties::earlyPreloadGlContext()) {
- queue().post([]() { GraphicBufferAllocator::getInstance(); });
- }
HardwareBitmapUploader::initialize();
}