aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPrintf_printf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrPrintf_printf.cpp')
-rw-r--r--src/gpu/GrPrintf_printf.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpu/GrPrintf_printf.cpp b/src/gpu/GrPrintf_printf.cpp
new file mode 100644
index 0000000000..909a4f0a64
--- /dev/null
+++ b/src/gpu/GrPrintf_printf.cpp
@@ -0,0 +1,29 @@
+
+/*
+ * 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 "GrTypes.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+
+void GrPrintf(const char format[], ...) {
+ const size_t MAX_BUFFER_SIZE = 2048;
+
+ char buffer[MAX_BUFFER_SIZE + 1];
+ va_list args;
+
+ va_start(args, format);
+ vsnprintf(buffer, MAX_BUFFER_SIZE, format, args);
+ va_end(args);
+
+ printf("%s", buffer);
+}
+
+