diff options
author | 2021-12-14 17:22:25 -0500 | |
---|---|---|
committer | 2021-12-15 14:51:40 -0500 | |
commit | e040b29e861bb21604caf0a70b5aa89a3441e426 (patch) | |
tree | 2135418bccfcd6c88909884b407ed3acc72c0051 | |
parent | f96aa9e82b8ad930fbd0476d27370c61d3b9a4d5 (diff) |
Defer initialization for mEglConfigA8
This will only be used by some devices, when requested by SystemUI.
Defer initialization until its needed. This removes the unnecessary
ALOGE. If the device needs A8 and doesn't have it, it will still emit a
fatal log, which will enclude the EGL error.
Bug: 210501051
Test: make
Change-Id: I2c45d910a272e6bf434b8dae52da88fb927ac82a
-rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp index 2f8ddeecced0..6c3541ee24f6 100644 --- a/libs/hwui/renderthread/EglManager.cpp +++ b/libs/hwui/renderthread/EglManager.cpp @@ -354,10 +354,6 @@ void EglManager::loadConfigs() { ALOGW("Failed to initialize 101010-2 format, error = %s", eglErrorString()); } - mEglConfigA8 = loadA8Config(mEglDisplay, mSwapBehavior); - if (mEglConfigA8 == EGL_NO_CONFIG_KHR) { - ALOGE("Failed to initialize A8 format, error = %s", eglErrorString()); - } } void EglManager::createContext() { @@ -431,9 +427,13 @@ Result<EGLSurface, EGLint> EglManager::createSurface(EGLNativeWindowType window, EGLConfig config = mEglConfig; if (colorMode == ColorMode::A8) { // A8 doesn't use a color space + if (!mEglConfigA8) { + mEglConfigA8 = loadA8Config(mEglDisplay, mSwapBehavior); + LOG_ALWAYS_FATAL_IF(!mEglConfigA8, + "Requested ColorMode::A8, but EGL lacks support! error = %s", + eglErrorString()); + } config = mEglConfigA8; - - LOG_ALWAYS_FATAL_IF(!mEglConfigA8, "Requested ColorMode::A8, but EGL lacks support!"); } else { if (!mHasWideColorGamutSupport) { colorMode = ColorMode::Default; |