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

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

Merge "Added screenshot after glDraw* option to GLES2 Debugger"

parents c7ec152b b33d5cff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ LOCAL_STATIC_LIBRARIES += libGLESv2_dbg libprotobuf-cpp-2.3.0-lite
LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libEGL

LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
# needed on sim build because of weird logging issues
ifeq ($(TARGET_SIMULATOR),true)
else
+4 −0
Original line number Diff line number Diff line
@@ -1650,6 +1650,10 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)

EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
{
    EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw);
    if (gEGLDebugLevel > 0)
        Debug_eglSwapBuffers(dpy, draw);

    clearError();

    SurfaceRef _s(draw);
+4 −5
Original line number Diff line number Diff line
@@ -3,11 +3,13 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
    src/DebuggerMessage.pb.cpp \
    src/api.cpp \
    src/debugger_message.pb.cpp \
    src/egl.cpp \
    src/server.cpp \
    src/shader.cpp \
    src/texture.cpp
    src/texture.cpp \
    src/vertex.cpp

LOCAL_C_INCLUDES :=	\
    $(LOCAL_PATH) \
@@ -16,9 +18,6 @@ LOCAL_C_INCLUDES := \
    external/protobuf/src \
    bionic

LOCAL_SHARED_LIBRARIES := libstlport libcutils libutils
LOCAL_LDLIBS := -lpthread

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

+0 −73
Original line number Diff line number Diff line
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os

def generate_DebuggerMessage(output,lines,i):
	for line in lines:
		if line.find("API_ENTRY(") >= 0:
			line = line[line.find("(") + 1: line.find(")")] #extract GL function name
			output.write("\t\t%s = %d;\n" % (line, i))
			i += 1
	return i


if __name__ == "__main__":
	output = open("DebuggerMessage.proto",'w')
	output.write( """// do not edit; auto generated by generate_DebuggerMessage_proto.py
package GLESv2Debugger;

option optimize_for = LITE_RUNTIME;

message Message
{
\trequired int32 context_id = 1; // GL context id
\tenum Function
\t{
""")

	i = 0;
	
	lines = open("gl2_api.in").readlines()
	i = generate_DebuggerMessage(output, lines, i)
	output.write("\t\t// end of GL functions\n")
	
	#lines = open("gl2ext_api.in").readlines()
	#i = generate_DebuggerMessage(output, lines, i)
	#output.write("\t\t// end of GL EXT functions\n")
	
	output.write("\t\tACK = %d;\n" % (i))
	i += 1
	
	output.write("\t\tNEG = %d;\n" % (i))
	i += 1
	
	output.write("\t\tCONTINUE = %d;\n" % (i))
	i += 1
	
	output.write("\t\tSKIP = %d;\n" % (i))
	i += 1
	
	output.write("""\t}
\trequired Function function = 2 [default = NEG]; // type/function of message
\trequired bool has_next_message = 3;
\trequired bool expect_response = 4;
\toptional int32 ret = 5; // return value from previous GL call
\toptional int32 arg0 = 6; // args to GL call
\toptional int32 arg1 = 7;
\toptional int32 arg2 = 8;
\toptional int32 arg3 = 9;
\toptional int32 arg4 = 16;
\toptional int32 arg5 = 17;
\toptional int32 arg6 = 18;
\toptional int32 arg7 = 19;
\toptional int32 arg8 = 20;
\toptional bytes data = 10; // variable length data used for GL call
\toptional float time = 11; // timing of previous GL call (seconds)
}
""")

	output.close()
	
	os.system("aprotoc --cpp_out=src --java_out=client/src DebuggerMessage.proto")
	os.system(' mv -f "src/DebuggerMessage.pb.cc" "src/DebuggerMessage.pb.cpp" ')
+0 −43
Original line number Diff line number Diff line
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os

if __name__ == "__main__":
	externs = []
	lines = open("enums.in").readlines()
	i = 0
	print "// auto generated by generate_GLFunction_java.py"
	print """package GLESv2Debugger;

public enum GLEnum
{"""
	
	index = 0
	for line in lines:
		value = line[line.find("(") + 1: line.find(",")]
		name = line[line.find(",") + 1: line.find(")")]	
		print "\t%s(%s)," % (name, value)

	print """\t;

\tpublic final int value;
\tGLEnum(final int value)
\t{
\t\tthis.value = value;
\t}

\tprivate static final java.util.HashMap<Integer, GLEnum> reverseMap = new java.util.HashMap<Integer, GLEnum>();
\tstatic 
\t{
\t\tfor (GLEnum e : GLEnum.values())
\t\t\treverseMap.put(e.value, e);
\t}

\tpublic static GLEnum valueOf(final int value)
\t{
\t\treturn reverseMap.get(value);
\t}
}"""

Loading