• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2006 The Android Open Source Project
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #include "include/core/SkTypes.h"
9 #if defined(SK_BUILD_FOR_ANDROID)
10 
11 #include <stdio.h>
12 
13 #define LOG_TAG "skia"
14 #include <android/log.h>
15 
16 // Print debug output to stdout as well.  This is useful for command line
17 // applications (e.g. skia_launcher).
18 bool gSkDebugToStdOut = false;
19 
SkDebugf(const char format[],...)20 void SkDebugf(const char format[], ...) {
21     va_list args1, args2;
22     va_start(args1, format);
23 
24     if (gSkDebugToStdOut) {
25         va_copy(args2, args1);
26         vprintf(format, args2);
27         va_end(args2);
28     }
29 
30     __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
31 
32     va_end(args1);
33 }
34 
35 #endif//defined(SK_BUILD_FOR_ANDROID)
36