diff options
author | John Reck <jreck@google.com> | 2018-11-15 15:21:29 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2018-11-15 15:22:29 -0800 |
commit | 8e539ca15c43b7148e9b30fe6b0dc02ce6a66dc4 (patch) | |
tree | ce3e2665962218c5516fa82a49c0f3921a8f5e0d /libs/hwui/renderthread/EglManager.cpp | |
parent | 9da5f37f8fd18044364ff3d2791338f9709721fc (diff) |
Add a sprinkle of speculative anti-crash dust
Bugs: way too many
Bug: 113367810
Test: well it builds...
Change-Id: If00bcaad1c535c4996b59c1b5a7d3a4bba849191
Diffstat (limited to 'libs/hwui/renderthread/EglManager.cpp')
-rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp index d4ffddde8def..65ced6ad9316 100644 --- a/libs/hwui/renderthread/EglManager.cpp +++ b/libs/hwui/renderthread/EglManager.cpp @@ -261,7 +261,7 @@ void EglManager::createPBufferSurface() { } } -EGLSurface EglManager::createSurface(EGLNativeWindowType window, ColorMode colorMode) { +Result<EGLSurface, EGLint> EglManager::createSurface(EGLNativeWindowType window, ColorMode colorMode) { LOG_ALWAYS_FATAL_IF(!hasEglContext(), "Not initialized"); bool wideColorGamut = colorMode == ColorMode::WideColorGamut && EglExtensions.glColorSpace && @@ -311,9 +311,9 @@ EGLSurface EglManager::createSurface(EGLNativeWindowType window, ColorMode color EGLSurface surface = eglCreateWindowSurface( mEglDisplay, wideColorGamut ? mEglConfigWideGamut : mEglConfig, window, attribs); - LOG_ALWAYS_FATAL_IF(surface == EGL_NO_SURFACE, - "Failed to create EGLSurface for window %p, eglErr = %s", (void*)window, - eglErrorString()); + if (surface == EGL_NO_SURFACE) { + return Error<EGLint> { eglGetError() }; + } if (mSwapBehavior != SwapBehavior::Preserved) { LOG_ALWAYS_FATAL_IF(eglSurfaceAttrib(mEglDisplay, surface, EGL_SWAP_BEHAVIOR, |