diff options
Diffstat (limited to 'gfx/skia/skia/src/ports/SkDebug_win.cpp')
-rw-r--r-- | gfx/skia/skia/src/ports/SkDebug_win.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/ports/SkDebug_win.cpp b/gfx/skia/skia/src/ports/SkDebug_win.cpp new file mode 100644 index 000000000..da1e2b573 --- /dev/null +++ b/gfx/skia/skia/src/ports/SkDebug_win.cpp @@ -0,0 +1,34 @@ +/* + * Copyright 2010 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkTypes.h" + +#if defined(SK_BUILD_FOR_WIN32) + +#include "SkLeanWindows.h" + +#include <stdarg.h> +#include <stdio.h> + +static const size_t kBufferSize = 2048; + +void SkDebugf(const char format[], ...) { + char buffer[kBufferSize + 1]; + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + fflush(stderr); // stderr seems to be buffered on Windows. + + va_start(args, format); + vsnprintf(buffer, kBufferSize, format, args); + va_end(args); + + OutputDebugStringA(buffer); +} +#endif//defined(SK_BUILD_FOR_WIN32) |