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

Commit da71e80c authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "don't log EGL errors due to unimplemented proprietary extensions"

parents ba8ecd20 97bc75d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1480,7 +1480,7 @@ EGLuint64NV eglGetSystemTimeFrequencyNV()
        }
    }

    return setError(EGL_BAD_DISPLAY, 0);;
    return setErrorQuiet(EGL_BAD_DISPLAY, 0);
}

EGLuint64NV eglGetSystemTimeNV()
@@ -1500,5 +1500,5 @@ EGLuint64NV eglGetSystemTimeNV()
        }
    }

    return setError(EGL_BAD_DISPLAY, 0);;
    return setErrorQuiet(EGL_BAD_DISPLAY, 0);
}
+13 −9
Original line number Diff line number Diff line
@@ -67,12 +67,14 @@ void egl_tls_t::validateTLSKey()
    }
}

void egl_tls_t::setErrorEtcImpl(const char* caller, int line, EGLint error) {
void egl_tls_t::setErrorEtcImpl(
        const char* caller, int line, EGLint error, bool quiet) {
    validateTLSKey();
    egl_tls_t* tls = getTLS();
    if (tls->error != error) {
        LOGE("%s:%d error %x (%s)", caller, line, error, egl_strerror(error));
        tls->error = error;
        if (!quiet) {
            LOGE("%s:%d error %x (%s)",
                    caller, line, error, egl_strerror(error));
            char value[PROPERTY_VALUE_MAX];
            property_get("debug.egl.callstack", value, "0");
            if (atoi(value)) {
@@ -81,6 +83,8 @@ void egl_tls_t::setErrorEtcImpl(const char* caller, int line, EGLint error) {
                stack.dump();
            }
        }
        tls->error = error;
    }
}

bool egl_tls_t::logNoContextCall() {
+9 −4
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@ class egl_tls_t {

    egl_tls_t();
    static void validateTLSKey();
    static void setErrorEtcImpl(const char* caller, int line, EGLint error);
    static void setErrorEtcImpl(
            const char* caller, int line, EGLint error, bool quiet);

public:
    static egl_tls_t* getTLS();
@@ -55,13 +56,17 @@ public:

    template<typename T>
    static T setErrorEtc(const char* caller,
            int line, EGLint error, T returnValue) {
        setErrorEtcImpl(caller, line, error);
            int line, EGLint error, T returnValue, bool quiet = false) {
        setErrorEtcImpl(caller, line, error, quiet);
        return returnValue;
    }
};

#define setError(_e, _r) egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r)
#define setError(_e, _r)        \
    egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r)

#define setErrorQuiet(_e, _r)   \
    egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r, true)

// ----------------------------------------------------------------------------