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

Commit 420e7906 authored by David Li's avatar David Li Committed by Android (Google) Code Review
Browse files

Merge "GLES2Dbg: change GLES2_dbg to shared library"

parents fd192393 ce30eb8a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ LOCAL_SRC_FILES:= \
	EGL/hooks.cpp 	       \
	EGL/Loader.cpp 	       \
#
LOCAL_STATIC_LIBRARIES += libGLESv2_dbg libprotobuf-cpp-2.3.0-lite liblzf
LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport

LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libEGL
LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
+11 −26
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include "egl_impl.h"
#include "Loader.h"
#include "glesv2dbg.h"
#include "egl_tls.h"

#define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r)

@@ -225,14 +226,11 @@ struct egl_context_t : public egl_object_t
    egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
            int impl, egl_connection_t const* cnx, int version)
    : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0),
      impl(impl), cnx(cnx), version(version), dbg(NULL)
      impl(impl), cnx(cnx), version(version)
    {
    }
    ~egl_context_t()
    {
        if (dbg)
            DestroyDbgContext(dbg);
        dbg = NULL;
    }
    EGLDisplay                  dpy;
    EGLContext                  context;
@@ -242,7 +240,6 @@ struct egl_context_t : public egl_object_t
    int                         impl;
    egl_connection_t const*     cnx;
    int                         version;
    DbgContext *                dbg;
};

struct egl_image_t : public egl_object_t
@@ -277,15 +274,6 @@ typedef egl_context_t::Ref ContextRef;
typedef egl_image_t::Ref    ImageRef;
typedef egl_sync_t::Ref     SyncRef;

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


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

static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS];
@@ -595,11 +583,6 @@ egl_context_t* get_context(EGLContext context) {
    return egl_to_native_cast<egl_context_t>(context);
}

DbgContext * getDbgContextThreadSpecific()
{
    return get_context(getContext())->dbg;
}

static inline
egl_image_t* get_image(EGLImageKHR image) {
    return egl_to_native_cast<egl_image_t>(image);
@@ -1442,10 +1425,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
        loseCurrent(cur_c);

        if (ctx != EGL_NO_CONTEXT) {
            if (!c->dbg && gEGLDebugLevel > 0)
                c->dbg = CreateDbgContext(c->version, c->cnx->hooks[c->version]);
            setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
            setContext(ctx);
            tls_t * const tls = getTLS();
            if (!tls->dbg && gEGLDebugLevel > 0)
                tls->dbg = CreateDbgContext(gEGLThreadLocalStorageKey, c->version,
                                            c->cnx->hooks[c->version]);
            _c.acquire();
            _r.acquire();
            _d.acquire();
+4 −3
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@ LOCAL_C_INCLUDES := \

#LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG
LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI

LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport
ifeq ($(TARGET_ARCH),arm)
	LOCAL_CFLAGS += -fstrict-aliasing
endif
@@ -43,4 +44,4 @@ endif
LOCAL_MODULE:= libGLESv2_dbg
LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
+7 −2
Original line number Diff line number Diff line
@@ -192,11 +192,16 @@ if __name__ == "__main__":
 
// auto generated by generate_api_cpp.py

#include <utils/Debug.h>

#include "src/header.h"
#include "src/api.h"

template<typename T> static int ToInt(const T & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (int &)t; }
template<typename T> static T FromInt(const int & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (T &)t; }
template<typename T> static int ToInt(const T & t)
{
    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
    return (int &)t;
}
"""    
    lines = open("gl2_api_annotated.in").readlines()
    generate_api(lines)
+0 −1
Original line number Diff line number Diff line
@@ -177,7 +177,6 @@ const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message &
{
    LOGD("GenerateCall function=%u", cmd.function());
    const int * ret = prevRet; // only some functions have return value
    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;
    nsecs_t c0 = systemTime(timeMode);
    switch (cmd.function()) {""")
    
Loading