aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/AndroidSkDebugToStdOut.cpp
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2014-12-10 10:23:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-10 10:23:06 -0800
commit6cfce1b7b4ad546b02823a1a0bbbda2c17b688f5 (patch)
treec2c2f6bcc68e1f5c879089fa9f5f8a44a40437e8 /tools/AndroidSkDebugToStdOut.cpp
parent96472deea70169396b8e1f576e470138f55fdb1f (diff)
Change how SkDebugf is sent to stdout on Android.
Previously, a function was called using dlsym in skia_launcher. Add a static initializer that changes the setting, and include that for the tools we automate for testing. Also only do va_copy if we actually use it. BUG=skia:2454 Review URL: https://codereview.chromium.org/753543003
Diffstat (limited to 'tools/AndroidSkDebugToStdOut.cpp')
-rw-r--r--tools/AndroidSkDebugToStdOut.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/AndroidSkDebugToStdOut.cpp b/tools/AndroidSkDebugToStdOut.cpp
new file mode 100644
index 0000000000..9dc991164d
--- /dev/null
+++ b/tools/AndroidSkDebugToStdOut.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// Need to include SkTypes before checking SK_BUILD_FOR_ANDROID, so it will be
+// set in the Android framework build.
+#include "SkTypes.h"
+#ifdef SK_BUILD_FOR_ANDROID
+extern bool gSkDebugToStdOut;
+
+// Use a static initializer to set gSkDebugToStdOut to true, sending SkDebugf
+// to stdout.
+class SendToStdOut {
+public:
+ SendToStdOut() {
+ gSkDebugToStdOut = true;
+ }
+};
+
+static SendToStdOut gSendToStdOut;
+#endif // SK_BUILD_FOR_ANDROID