Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-mesa: Commit

external/mesa


Commit MetaInfo

Révisionbac7f727d098936491fa9a8b392c0ada46a8995a (tree)
l'heure2017-12-12 18:49:18
AuteurWuZhen <wuzhen@jide...>
CommiterChih-Wei Huang

Message de Log

android: print debug info to logcat

Redirect logs printed to stderr to logcat.

Change-Id: I58e3966a608af361b86c54b4c95a92561b711968
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>

Change Summary

Modification

--- a/src/gallium/auxiliary/os/os_misc.c
+++ b/src/gallium/auxiliary/os/os_misc.c
@@ -46,8 +46,10 @@
4646
4747 #endif
4848
49-
50-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
49+#if defined(PIPE_OS_ANDROID)
50+# define LOG_TAG "gallium"
51+# include <log/log.h>
52+#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
5153 # include <unistd.h>
5254 #elif defined(PIPE_OS_APPLE) || defined(PIPE_OS_BSD)
5355 # include <sys/sysctl.h>
@@ -100,6 +102,12 @@ os_log_message(const char *message)
100102 fflush(fout);
101103 }
102104 #else /* !PIPE_SUBSYSTEM_WINDOWS */
105+#if defined(PIPE_OS_ANDROID)
106+ if (fout == stderr) {
107+ ALOGD("%s", message);
108+ return;
109+ }
110+#endif
103111 fflush(stdout);
104112 fputs(message, fout);
105113 fflush(fout);
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -55,7 +55,7 @@ void
5555 _debug_vprintf(const char *format, va_list ap)
5656 {
5757 static char buf[4096] = {'\0'};
58-#if defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED)
58+#if defined(PIPE_OS_WINDOWS) || defined(PIPE_OS_ANDROID) || defined(PIPE_SUBSYSTEM_EMBEDDED)
5959 /* We buffer until we find a newline. */
6060 size_t len = strlen(buf);
6161 int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap);
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -41,6 +41,7 @@ LOCAL_LDFLAGS := \
4141
4242 LOCAL_SHARED_LIBRARIES := \
4343 libdl \
44+ liblog \
4445 libglapi \
4546 libexpat \
4647 libz
--- a/src/mesa/main/errors.c
+++ b/src/mesa/main/errors.c
@@ -36,6 +36,10 @@
3636 #include "context.h"
3737 #include "debug_output.h"
3838
39+#if defined(ANDROID)
40+# define LOG_TAG "mesa"
41+# include <log/log.h>
42+#endif
3943
4044 static FILE *LogFile = NULL;
4145
@@ -89,6 +93,10 @@ output_if_debug(const char *prefixString, const char *outputString,
8993 _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
9094 OutputDebugStringA(buf);
9195 }
96+#elif defined(ANDROID)
97+ {
98+ ALOGD("%s: %s", prefixString, outputString);
99+ }
92100 #endif
93101 }
94102 }
Afficher sur ancien navigateur de dépôt.