Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57d1357 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

libEGL: silence warnings for client extension querying

Client extensions may be queried by

  eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);

Generate EGL_BAD_DISPLAY, but do not log the error.

Bug: 30301853
Change-Id: Ie67987b0ec0a8e70937e8baa16baa4f1a204915f
parent dfaa4290
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1133,6 +1133,16 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name)
{
    clearError();

    // Generate an error quietly when client extensions (as defined by
    // EGL_EXT_client_extensions) are queried.  We do not want to rely on
    // validate_display to generate the error as validate_display would log
    // the error, which can be misleading.
    //
    // If we want to support EGL_EXT_client_extensions later, we can return
    // the client extension string here instead.
    if (dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS)
        return setErrorQuiet(EGL_BAD_DISPLAY, nullptr);

    const egl_display_ptr dp = validate_display(dpy);
    if (!dp) return (const char *) NULL;