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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « platform_tools/android/launcher/skia_launcher.cpp ('k') | tools/AndroidSkDebugToStdOut.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10 #include "SkTypes.h" 8 #include "SkTypes.h"
11 #include <stdio.h> 9 #include <stdio.h>
12 10
13 #define LOG_TAG "skia" 11 #define LOG_TAG "skia"
14 #include <android/log.h> 12 #include <android/log.h>
15 13
16 static bool gSkDebugToStdOut = false; 14 // Print debug output to stdout as well. This is useful for command line
17 15 // applications (e.g. skia_launcher). To enable, include android_output as a
18 extern "C" void AndroidSkDebugToStdOut(bool debugToStdOut) { 16 // gyp dependency.
19 gSkDebugToStdOut = debugToStdOut; 17 bool gSkDebugToStdOut = false;
20 }
21 18
22 void SkDebugf(const char format[], ...) { 19 void SkDebugf(const char format[], ...) {
23 va_list args1, args2; 20 va_list args1, args2;
24 va_start(args1, format); 21 va_start(args1, format);
25 va_copy(args2, args1); 22
23 if (gSkDebugToStdOut) {
24 va_copy(args2, args1);
25 vprintf(format, args2);
26 va_end(args2);
27 }
28
26 __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1); 29 __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
27 30
28 // Print debug output to stdout as well. This is useful for command
29 // line applications (e.g. skia_launcher)
30 if (gSkDebugToStdOut) {
31 vprintf(format, args2);
32 }
33
34 va_end(args1); 31 va_end(args1);
35 va_end(args2);
36 } 32 }
OLDNEW
« 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