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

Unified Diff: src/ports/SkDebug_android.cpp

Issue 753543003: Change how SkDebugf is sent to stdout on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment. Created 6 years 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 | « platform_tools/android/launcher/skia_launcher.cpp ('k') | tools/AndroidSkDebugToStdOut.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkDebug_android.cpp
diff --git a/src/ports/SkDebug_android.cpp b/src/ports/SkDebug_android.cpp
index 2795c0444a1bf5b907f77d0e5d91590e0e0c039e..4ab9ad24d3f1f1edc06fbc7c5699394286bed991 100644
--- a/src/ports/SkDebug_android.cpp
+++ b/src/ports/SkDebug_android.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -6,31 +5,28 @@
* found in the LICENSE file.
*/
-
#include "SkTypes.h"
#include <stdio.h>
#define LOG_TAG "skia"
#include <android/log.h>
-static bool gSkDebugToStdOut = false;
-
-extern "C" void AndroidSkDebugToStdOut(bool debugToStdOut) {
- gSkDebugToStdOut = debugToStdOut;
-}
+// Print debug output to stdout as well. This is useful for command line
+// applications (e.g. skia_launcher). To enable, include android_output as a
+// gyp dependency.
+bool gSkDebugToStdOut = false;
void SkDebugf(const char format[], ...) {
va_list args1, args2;
va_start(args1, format);
- va_copy(args2, args1);
- __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
- // Print debug output to stdout as well. This is useful for command
- // line applications (e.g. skia_launcher)
if (gSkDebugToStdOut) {
+ va_copy(args2, args1);
vprintf(format, args2);
+ va_end(args2);
}
+ __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
+
va_end(args1);
- va_end(args2);
}
« no previous file with comments | « platform_tools/android/launcher/skia_launcher.cpp ('k') | tools/AndroidSkDebugToStdOut.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698