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

Commit 61e701c0 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge changes 9415,9416

* changes:
  log opengl-call-with-no-context only once per thread, instead of for each function call
  don't crash in Parcel when given a null (and therfore invalid) native_handle_t
parents 334a4a7c d274eae5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -661,7 +661,7 @@ status_t Parcel::writeWeakBinder(const wp<IBinder>& val)

status_t Parcel::writeNativeHandle(const native_handle* handle)
{
    if (handle->version != sizeof(native_handle))
    if (!handle || handle->version != sizeof(native_handle))
        return BAD_TYPE;

    status_t err;
+9 −2
Original line number Diff line number Diff line
@@ -135,9 +135,10 @@ struct egl_image_t : public egl_object_t<'_img'>

struct tls_t
{
    tls_t() : error(EGL_SUCCESS), ctx(0) { }
    tls_t() : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) { }
    EGLint      error;
    EGLContext  ctx;
    EGLBoolean  logCallWithNoContext;
};


@@ -352,8 +353,14 @@ static int ext_context_lost() {
}

static void gl_no_context() {
    LOGE("call to OpenGL ES API with no current context");
    tls_t* tls = getTLS();
    if (tls->logCallWithNoContext == EGL_TRUE) {
        tls->logCallWithNoContext = EGL_FALSE;
        LOGE("call to OpenGL ES API with no current context "
             "(logged once per thread)");
    }
}

static void early_egl_init(void) 
{
#if !USE_FAST_TLS_KEY