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

Commit 85f33a71 authored by David Li's avatar David Li
Browse files

GLES2Debugger: Make command exchange async to improve performance.



In message loop, use select to check for available commands from client,
 rather than always expecting commands in eglSwapBuffers.

Change-Id: Ifc34dd77c2528c8b9c71f594e3eda4f93400cd2b
Signed-off-by: default avatarDavid Li <davidxli@google.com>
parent e57e840d
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -340,7 +340,10 @@ static void initEglTraceLevel() {
    }
    }
    
    
    if (gEGLDebugLevel > 0)
    if (gEGLDebugLevel > 0)
        StartDebugServer();
    {
        property_get("debug.egl.debug_port", value, "5039");
        StartDebugServer(atoi(value));
    }
}
}


static void setGLHooksThreadSpecific(gl_hooks_t const *value) {
static void setGLHooksThreadSpecific(gl_hooks_t const *value) {
@@ -350,7 +353,6 @@ static void setGLHooksThreadSpecific(gl_hooks_t const *value) {
    } else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
    } else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
        setGlTraceThreadSpecific(value);
        setGlTraceThreadSpecific(value);
        setGlThreadSpecific(&gHooksDebug);
        setGlThreadSpecific(&gHooksDebug);
        LOGD("\n* setGLHooksThreadSpecific gHooksDebug");
    } else {
    } else {
        setGlThreadSpecific(value);
        setGlThreadSpecific(value);
    }
    }
+0 −3
Original line number Original line Diff line number Diff line
@@ -98,9 +98,6 @@ message Message
    output.write("        SETPROP = %d;\n" % (i))
    output.write("        SETPROP = %d;\n" % (i))
    i += 1
    i += 1
    
    
    output.write("        CAPTURE = %d;\n" % (i))
    i += 1

    output.write("""    }
    output.write("""    }
    required Function function = 2 [default = NEG]; // type/function of message
    required Function function = 2 [default = NEG]; // type/function of message
    enum Type
    enum Type
+6 −2
Original line number Original line Diff line number Diff line
@@ -65,7 +65,8 @@ void DbgContext::Fetch(const unsigned index, std::string * const data) const


void DbgContext::glUseProgram(GLuint program)
void DbgContext::glUseProgram(GLuint program)
{
{
    assert(GL_NO_ERROR == hooks->gl.glGetError());
    while (GLenum error = hooks->gl.glGetError())
        LOGD("DbgContext::glUseProgram: before glGetError() = 0x%.4X", error);
        
        
    this->program = program;
    this->program = program;


@@ -106,6 +107,9 @@ void DbgContext::glUseProgram(GLuint program)
            maxAttrib = slot;
            maxAttrib = slot;
    }
    }
    delete name;
    delete name;
    
    while (GLenum error = hooks->gl.glGetError())
        LOGD("DbgContext::glUseProgram: after glGetError() = 0x%.4X", error);
}
}


static bool HasNonVBOAttribs(const DbgContext * const ctx)
static bool HasNonVBOAttribs(const DbgContext * const ctx)
+0 −2
Original line number Original line Diff line number Diff line
@@ -229,7 +229,6 @@ bool Message_Function_IsValid(int value) {
    case 188:
    case 188:
    case 189:
    case 189:
    case 190:
    case 190:
    case 191:
      return true;
      return true;
    default:
    default:
      return false;
      return false;
@@ -428,7 +427,6 @@ const Message_Function Message::NEG;
const Message_Function Message::CONTINUE;
const Message_Function Message::CONTINUE;
const Message_Function Message::SKIP;
const Message_Function Message::SKIP;
const Message_Function Message::SETPROP;
const Message_Function Message::SETPROP;
const Message_Function Message::CAPTURE;
const Message_Function Message::Function_MIN;
const Message_Function Message::Function_MIN;
const Message_Function Message::Function_MAX;
const Message_Function Message::Function_MAX;
const int Message::Function_ARRAYSIZE;
const int Message::Function_ARRAYSIZE;
+2 −4
Original line number Original line Diff line number Diff line
@@ -226,12 +226,11 @@ enum Message_Function {
  Message_Function_NEG = 187,
  Message_Function_NEG = 187,
  Message_Function_CONTINUE = 188,
  Message_Function_CONTINUE = 188,
  Message_Function_SKIP = 189,
  Message_Function_SKIP = 189,
  Message_Function_SETPROP = 190,
  Message_Function_SETPROP = 190
  Message_Function_CAPTURE = 191
};
};
bool Message_Function_IsValid(int value);
bool Message_Function_IsValid(int value);
const Message_Function Message_Function_Function_MIN = Message_Function_glActiveTexture;
const Message_Function Message_Function_Function_MIN = Message_Function_glActiveTexture;
const Message_Function Message_Function_Function_MAX = Message_Function_CAPTURE;
const Message_Function Message_Function_Function_MAX = Message_Function_SETPROP;
const int Message_Function_Function_ARRAYSIZE = Message_Function_Function_MAX + 1;
const int Message_Function_Function_ARRAYSIZE = Message_Function_Function_MAX + 1;


enum Message_Type {
enum Message_Type {
@@ -488,7 +487,6 @@ class Message : public ::google::protobuf::MessageLite {
  static const Function CONTINUE = Message_Function_CONTINUE;
  static const Function CONTINUE = Message_Function_CONTINUE;
  static const Function SKIP = Message_Function_SKIP;
  static const Function SKIP = Message_Function_SKIP;
  static const Function SETPROP = Message_Function_SETPROP;
  static const Function SETPROP = Message_Function_SETPROP;
  static const Function CAPTURE = Message_Function_CAPTURE;
  static inline bool Function_IsValid(int value) {
  static inline bool Function_IsValid(int value) {
    return Message_Function_IsValid(value);
    return Message_Function_IsValid(value);
  }
  }
Loading