Hash :
e738f5bc
Author :
Date :
2025-06-30T16:54:25
EGLWindow: Fix eglGetError in initializeSurface() From the EGL 1.5 spec: # Chapter 3 EGL Functions and Errors ## 3.1 Errors Additional information about the success or failure of the most recent EGL function called in a specific thread[1], in the form of an error code, can be obtained by calling EGLint eglGetError(void); [1] Note that calling eglGetError twice without any other intervening EGL calls will always return EGL_SUCCESS on the second call, since eglGetError is itself an EGL function, and the second call is reporting the success or failure of the first call. In other words, error checking must always be performed immediately after an EGL function fails. EGLWindow::initializeSurface() is checking the status of eglCreateWindowSurface() with eglGetError() and then calling eglGetError() again in the error log message. This results in the error message always containing 0x3000 (EGL_SUCCESS), as the spec states. Fix this by capturing the value of eglGetError() and then using the captured value in both the conditional and the log statement. Bug: b/279980674 Change-Id: I6310996b83960752a9b0d5e0bf40f5aab23174c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6692271 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>