• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2   * 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.
6   */
7  
8  #include "SkTypes.h"
9  
10  #if defined(SK_BUILD_FOR_WIN)
11  
12  #include "SkLeanWindows.h"
13  
14  #include <stdarg.h>
15  #include <stdio.h>
16  
17  static const size_t kBufferSize = 2048;
18  
19  void SkDebugf(const char format[], ...) {
20      char    buffer[kBufferSize + 1];
21      va_list args;
22  
23      va_start(args, format);
24      vfprintf(stderr, format, args);
25      va_end(args);
26      fflush(stderr);  // stderr seems to be buffered on Windows.
27  
28      va_start(args, format);
29      vsnprintf(buffer, kBufferSize, format, args);
30      va_end(args);
31  
32      OutputDebugStringA(buffer);
33  }
34  #endif//defined(SK_BUILD_FOR_WIN)
35