Add ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER, to output trace to debugger window

Change-Id: I7be71c41b0ec3a77f508c90c2de3331c9522a11b
Reviewed-on: https://chromium-review.googlesource.com/223592
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/common/debug.cpp b/src/common/debug.cpp
index 42fe1f4..e09d560 100644
--- a/src/common/debug.cpp
+++ b/src/common/debug.cpp
@@ -23,7 +23,7 @@
 typedef void (*PerfOutputFunction)(unsigned int, const wchar_t*);
 #endif
 
-static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
+static void output(bool traceInDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
 {
 #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS) || defined(ANGLE_ENABLE_DEBUG_TRACE)
     std::string formattedMessage = FormatString(format, vararg);
@@ -47,7 +47,7 @@
 
 #if defined(ANGLE_ENABLE_DEBUG_TRACE)
 #if defined(NDEBUG)
-    if (traceFileDebugOnly)
+    if (traceInDebugOnly)
     {
         return;
     }
@@ -60,17 +60,21 @@
         file.flush();
     }
 
+#if defined(ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER)
+    OutputDebugStringA(formattedMessage.c_str());
+#endif // ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER
+
 #endif // ANGLE_ENABLE_DEBUG_TRACE
 }
 
-void trace(bool traceFileDebugOnly, const char *format, ...)
+void trace(bool traceInDebugOnly, const char *format, ...)
 {
     va_list vararg;
     va_start(vararg, format);
 #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
-    output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg);
+    output(traceInDebugOnly, D3DPERF_SetMarker, format, vararg);
 #else
-    output(traceFileDebugOnly, NULL, format, vararg);
+    output(traceInDebugOnly, NULL, format, vararg);
 #endif
     va_end(vararg);
 }