blob: da1e2b573fcf8d9fd5913722202476b274f73b00 [file] [log] [blame]
reed@google.combaf7a072011-05-02 19:11:37 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2010 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
reed@google.combaf7a072011-05-02 19:11:37 +00006 */
7
reed@google.combaf7a072011-05-02 19:11:37 +00008#include "SkTypes.h"
halcanary4dbbd042016-06-07 17:21:10 -07009
mtklein1ee76512015-11-02 10:20:27 -080010#if defined(SK_BUILD_FOR_WIN32)
reed@google.combaf7a072011-05-02 19:11:37 +000011
halcanary4dbbd042016-06-07 17:21:10 -070012#include "SkLeanWindows.h"
reed@google.combaf7a072011-05-02 19:11:37 +000013
14#include <stdarg.h>
15#include <stdio.h>
halcanary4dbbd042016-06-07 17:21:10 -070016
17static const size_t kBufferSize = 2048;
reed@google.combaf7a072011-05-02 19:11:37 +000018
19void SkDebugf(const char format[], ...) {
20 char buffer[kBufferSize + 1];
21 va_list args;
bsalomon@google.com8890af32013-03-07 18:44:34 +000022
23 va_start(args, format);
mtkleinbdef1402015-10-28 09:50:31 -070024 vfprintf(stderr, format, args);
bsalomon@google.com8890af32013-03-07 18:44:34 +000025 va_end(args);
mtkleine4881b62015-10-28 10:02:06 -070026 fflush(stderr); // stderr seems to be buffered on Windows.
bsalomon@google.com8890af32013-03-07 18:44:34 +000027
reed@google.combaf7a072011-05-02 19:11:37 +000028 va_start(args, format);
29 vsnprintf(buffer, kBufferSize, format, args);
30 va_end(args);
31
reed@google.com59d2f632011-05-02 19:36:59 +000032 OutputDebugStringA(buffer);
reed@google.combaf7a072011-05-02 19:11:37 +000033}
mtklein1ee76512015-11-02 10:20:27 -080034#endif//defined(SK_BUILD_FOR_WIN32)