1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/ports/SkDebug_win.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2010 Google Inc. 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 + 1.14 +#include "SkTypes.h" 1.15 + 1.16 +static const size_t kBufferSize = 2048; 1.17 + 1.18 +#include <stdarg.h> 1.19 +#include <stdio.h> 1.20 +#include <windows.h> 1.21 + 1.22 +void SkDebugf(const char format[], ...) { 1.23 + char buffer[kBufferSize + 1]; 1.24 + va_list args; 1.25 + 1.26 + va_start(args, format); 1.27 + vprintf(format, args); 1.28 + va_end(args); 1.29 + // When we crash on Windows we often are missing a lot of prints. Since we don't really care 1.30 + // about SkDebugf performance we flush after every print. 1.31 + fflush(stdout); 1.32 + 1.33 + va_start(args, format); 1.34 + vsnprintf(buffer, kBufferSize, format, args); 1.35 + va_end(args); 1.36 + 1.37 + OutputDebugStringA(buffer); 1.38 +}