Create HintSessionWrapper right after CanvasContext
Move the construction of the HintSessionWrapper to RT right after the
creation of the CanvasContext to ensure enough time is provided to
not block the critical path in most cases.
Bug: 266560774
Test: manual
Change-Id: I1a67b163acd9c41156d9b9e14e974c67b6ba6ed5
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index db4d1dc..0d091b3 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -194,8 +194,6 @@
ATRACE_CALL();
if (window) {
- // Ensure the hint session is running here, away from any critical paths
- mHintSessionWrapper.init();
mNativeSurface = std::make_unique<ReliableSurface>(window);
mNativeSurface->init();
if (enableTimeout) {
@@ -1033,6 +1031,10 @@
mSyncDelayDuration = duration;
}
+void CanvasContext::startHintSession() {
+ mHintSessionWrapper.init();
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */