Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: ports/xaos/nacl-ui-driver/ui_nacl.c

Issue 1491453003: Fix Xaos port (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ports/xaos/nacl-ui-driver/ui_nacl.h ('k') | ports/xaos/xaos.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ports/xaos/nacl-ui-driver/ui_nacl.c
diff --git a/ports/xaos/nacl-ui-driver/ui_nacl.c b/ports/xaos/nacl-ui-driver/ui_nacl.c
index 10b28334812e2fed0cf3223daf8998772bf0ce3b..a370a039f4fd4b3c0953e2e6478dc275de72d7d4 100644
--- a/ports/xaos/nacl-ui-driver/ui_nacl.c
+++ b/ports/xaos/nacl-ui-driver/ui_nacl.c
@@ -5,11 +5,13 @@
*/
#include "aconfig.h"
+#include "fconfig.h"
#include "ui_nacl.h"
/*includes */
#include <ui.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -25,6 +27,21 @@ int kill() {
return -1;
}
+#ifdef NDEBUG
+static int log_level = LOG_INFO;
+#else
+static int log_level = LOG_TRACE;
+#endif
+
+void NaClLog(int level, char* fmt, ...) {
+ if (level > log_level)
+ return;
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
struct {
void* buffers[2];
int current_buffer;
@@ -42,20 +59,19 @@ static void nacl_print(int x, int y, CONST char* text) {
static void nacl_flush(void) {
void* data = VideoBuffers.buffers[VideoBuffers.current_buffer];
- NaClLog(LOG_INFO, "nacl_flush %d %p\n", VideoBuffers.current_buffer, data);
+ NaClLog(LOG_TRACE, "nacl_flush %d\n", VideoBuffers.current_buffer);
if (!data)
return;
- CHECK(data != NULL);
CopyImageDataToVideo(data);
}
static void nacl_display() {
- NaClLog(LOG_INFO, "nacl_display\n");
+ NaClLog(LOG_TRACE, "nacl_display\n");
nacl_flush();
}
static void nacl_flip_buffers() {
- NaClLog(LOG_INFO, "nacl_flip_buffers\n");
+ NaClLog(LOG_TRACE, "nacl_flip_buffers\n");
VideoBuffers.current_buffer ^= 1;
}
« no previous file with comments | « ports/xaos/nacl-ui-driver/ui_nacl.h ('k') | ports/xaos/xaos.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698