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

Commit aaa9b13e authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'master' into honeycomb-release

parents 190c28f6 98ab9bb2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ field_slot_t * CursorWindow::allocRow()
    uint32_t fieldDirOffset = alloc(fieldDirSize);
    if (!fieldDirOffset) {
        mHeader->numRows--;
        LOGE("The row failed, so back out the new row accounting from allocRowSlot %d", mHeader->numRows);
        LOG_WINDOW("The row failed, so back out the new row accounting from allocRowSlot %d", mHeader->numRows);
        return NULL;
    }
    field_slot_t * fieldDir = (field_slot_t *)offsetToPtr(fieldDirOffset);
+11 −0
Original line number Diff line number Diff line
@@ -867,7 +867,18 @@ int Surface::setBuffersGeometry(int w, int h, int format)
        return BAD_VALUE;

    Mutex::Autolock _l(mSurfaceLock);
    if (mConnected == NATIVE_WINDOW_API_EGL) {
        return INVALID_OPERATION;
    }

    mBufferInfo.set(w, h, format);
    if (format != 0) {
        // we update the format of the surface as reported by query().
        // this is to allow applications to change the format of a surface's
        // buffer, and have it reflected in EGL; which is needed for
        // EGLConfig validation.
        mFormat = format;
    }
    return NO_ERROR;
}

+7 −4
Original line number Diff line number Diff line
@@ -833,6 +833,9 @@ struct config_management_t {
    static bool mask(GLint reqValue, GLint confValue) {
        return (confValue & reqValue) == reqValue;
    }
    static bool ignore(GLint reqValue, GLint confValue) {
        return true;
    }
};

// ----------------------------------------------------------------------------
@@ -1060,11 +1063,11 @@ static config_management_t const gConfigManagement[] = {
        { EGL_CONFIG_CAVEAT,              config_management_t::exact   },
        { EGL_CONFIG_ID,                  config_management_t::exact   },
        { EGL_LEVEL,                      config_management_t::exact   },
        { EGL_MAX_PBUFFER_HEIGHT,         config_management_t::exact   },
        { EGL_MAX_PBUFFER_PIXELS,         config_management_t::exact   },
        { EGL_MAX_PBUFFER_WIDTH,          config_management_t::exact   },
        { EGL_MAX_PBUFFER_HEIGHT,         config_management_t::ignore   },
        { EGL_MAX_PBUFFER_PIXELS,         config_management_t::ignore   },
        { EGL_MAX_PBUFFER_WIDTH,          config_management_t::ignore   },
        { EGL_NATIVE_RENDERABLE,          config_management_t::exact   },
        { EGL_NATIVE_VISUAL_ID,           config_management_t::exact   },
        { EGL_NATIVE_VISUAL_ID,           config_management_t::ignore   },
        { EGL_NATIVE_VISUAL_TYPE,         config_management_t::exact   },
        { EGL_SAMPLES,                    config_management_t::exact   },
        { EGL_SAMPLE_BUFFERS,             config_management_t::exact   },
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES:= 	       \
	EGL/egl.cpp 	       \
	EGL/trace.cpp              \
	EGL/getProcAddress.cpp.arm \
	EGL/hooks.cpp 	       \
	EGL/Loader.cpp 	       \
@@ -33,6 +34,7 @@ endif
LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
LOCAL_CFLAGS += -fvisibility=hidden
LOCAL_CFLAGS += -DEGL_TRACE=1

ifeq ($(TARGET_BOARD_PLATFORM),msm7k)
LOCAL_CFLAGS += -DADRENO130=1
+73 −6
Original line number Diff line number Diff line
@@ -285,6 +285,58 @@ EGLAPI gl_hooks_t gHooks[2][IMPL_NUM_IMPLEMENTATIONS];
EGLAPI gl_hooks_t gHooksNoContext;
EGLAPI pthread_key_t gGLWrapperKey = -1;

#if EGL_TRACE

EGLAPI pthread_key_t gGLTraceKey = -1;

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

static int gEGLTraceLevel;
static int gEGLApplicationTraceLevel;
extern EGLAPI gl_hooks_t gHooksTrace;

static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
    pthread_setspecific(gGLTraceKey, value);
}

gl_hooks_t const* getGLTraceThreadSpecific() {
    return static_cast<gl_hooks_t*>(pthread_getspecific(gGLTraceKey));
}

static void initEglTraceLevel() {
    char value[PROPERTY_VALUE_MAX];
    property_get("debug.egl.trace", value, "0");
    int propertyLevel = atoi(value);
    int applicationLevel = gEGLApplicationTraceLevel;
    gEGLTraceLevel = propertyLevel > applicationLevel ? propertyLevel : applicationLevel;
}

static void setGLHooksThreadSpecific(gl_hooks_t const *value) {
    if (gEGLTraceLevel > 0) {
        setGlTraceThreadSpecific(value);
        setGlThreadSpecific(&gHooksTrace);
    } else {
        setGlThreadSpecific(value);
    }
}

/*
 * Global entry point to allow applications to modify their own trace level.
 * The effective trace level is the max of this level and the value of debug.egl.trace.
 */
extern "C"
void setGLTraceLevel(int level) {
    gEGLApplicationTraceLevel = level;
}

#else

static inline void setGLHooksThreadSpecific(gl_hooks_t const *value) {
    setGlThreadSpecific(value);
}

#endif

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

static __attribute__((noinline))
@@ -458,6 +510,10 @@ static void early_egl_init(void)
{
#if !USE_FAST_TLS_KEY
    pthread_key_create(&gGLWrapperKey, NULL);
#endif
#if EGL_TRACE
    pthread_key_create(&gGLTraceKey, NULL);
    initEglTraceLevel();
#endif
    uint32_t addr = (uint32_t)((void*)gl_no_context);
    android_memset32(
@@ -465,7 +521,7 @@ static void early_egl_init(void)
            addr, 
            sizeof(gHooksNoContext));

    setGlThreadSpecific(&gHooksNoContext);
    setGLHooksThreadSpecific(&gHooksNoContext);
}

static pthread_once_t once_control = PTHREAD_ONCE_INIT;
@@ -678,7 +734,15 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
        return EGL_TRUE;
    }

    setGlThreadSpecific(&gHooksNoContext);
#if EGL_TRACE

    // Called both at early_init time and at this time. (Early_init is pre-zygote, so
    // the information from that call may be stale.)
    initEglTraceLevel();

#endif

    setGLHooksThreadSpecific(&gHooksNoContext);

    // initialize each EGL and
    // build our own extension string first, based on the extension we know
@@ -1238,11 +1302,11 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,

        // cur_c has to be valid here (but could be terminated)
        if (ctx != EGL_NO_CONTEXT) {
            setGlThreadSpecific(c->cnx->hooks[c->version]);
            setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
            setContext(ctx);
            _c.acquire();
        } else {
            setGlThreadSpecific(&gHooksNoContext);
            setGLHooksThreadSpecific(&gHooksNoContext);
            setContext(EGL_NO_CONTEXT);
        }
        _cur_c.release();
@@ -1434,6 +1498,9 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
                    // Extensions are independent of the bound context
                    cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] =
                    cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] =
#if EGL_TRACE
                    gHooksTrace.ext.extensions[slot] =
#endif
                            cnx->egl.eglGetProcAddress(procname);
                }
            }
Loading