#include <system/window.h>
#include <hardware/gralloc.h>
#include <gralloc_drm_handle.h>
-#include <cutils/log.h>
#endif /* HAVE_ANDROID_PLATFORM */
return (fd >= 0) ? fcntl(fd, F_DUPFD_CLOEXEC, 3) : -1;
}
-/* support versions < JellyBean */
-#ifndef ALOGW
-#define ALOGW LOGW
-#endif
-#ifndef ALOGD
-#define ALOGD LOGD
-#endif
-#ifndef ALOGI
-#define ALOGI LOGI
-#endif
-
-static void
-droid_log(EGLint level, const char *msg)
-{
- switch (level) {
- case _EGL_DEBUG:
- ALOGD("%s", msg);
- break;
- case _EGL_INFO:
- ALOGI("%s", msg);
- break;
- case _EGL_WARNING:
- ALOGW("%s", msg);
- break;
- case _EGL_FATAL:
- LOG_FATAL("%s", msg);
- break;
- default:
- break;
- }
-}
-
static struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
.create_window_surface = droid_create_window_surface,
const char *err;
int ret;
- _eglSetLogProc(droid_log);
-
loader_set_logger(_eglLog);
dri2_dpy = calloc(1, sizeof(*dri2_dpy));
#include "egllog.h"
+#ifdef HAVE_ANDROID_PLATFORM
+#define LOG_TAG "EGL-MAIN"
+#include <cutils/log.h>
+
+/* support versions < JellyBean */
+#ifndef ALOGW
+#define ALOGW LOGW
+#endif
+#ifndef ALOGD
+#define ALOGD LOGD
+#endif
+#ifndef ALOGI
+#define ALOGI LOGI
+#endif
+
+#endif /* HAVE_ANDROID_PLATFORM */
+
#define MAXSTRING 1000
#define FALLBACK_LOG_LEVEL _EGL_WARNING
static void
_eglDefaultLogger(EGLint level, const char *msg)
{
+#ifdef HAVE_ANDROID_PLATFORM
+ switch (level) {
+ case _EGL_DEBUG:
+ ALOGD("%s", msg);
+ break;
+ case _EGL_INFO:
+ ALOGI("%s", msg);
+ break;
+ case _EGL_WARNING:
+ ALOGW("%s", msg);
+ break;
+ case _EGL_FATAL:
+ LOG_FATAL("%s", msg);
+ break;
+ default:
+ break;
+ }
+#else
fprintf(stderr, "libEGL %s: %s\n", level_strings[level], msg);
+#endif /* HAVE_ANDROID_PLATFORM */
}