SkDebug_android.cpp 796 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include "include/core/SkTypes.h"
  8. #if defined(SK_BUILD_FOR_ANDROID)
  9. #include <stdio.h>
  10. #define LOG_TAG "skia"
  11. #include <android/log.h>
  12. // Print debug output to stdout as well. This is useful for command line
  13. // applications (e.g. skia_launcher).
  14. bool gSkDebugToStdOut = false;
  15. void SkDebugf(const char format[], ...) {
  16. va_list args1, args2;
  17. va_start(args1, format);
  18. if (gSkDebugToStdOut) {
  19. va_copy(args2, args1);
  20. vprintf(format, args2);
  21. va_end(args2);
  22. }
  23. __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1);
  24. va_end(args1);
  25. }
  26. #endif//defined(SK_BUILD_FOR_ANDROID)