aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Kinross <aukinros@microsoft.com>2014-10-20 14:36:18 -0700
committerGeoff Lang <geofflang@chromium.org>2014-10-28 19:27:20 +0000
commitfe14d455c240b756a66ea2cb20ad3e22f9a12cec (patch)
tree062f9e07d8a0220a0415b5c1fd815c8b9d44b3b2
parentf0360c600497de805722f178417ed2f1d4b7567c (diff)
downloadangle-fe14d455c240b756a66ea2cb20ad3e22f9a12cec.tar.gz
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>
-rw-r--r--src/common/debug.cpp14
-rw-r--r--src/common/debug.h4
2 files changed, 11 insertions, 7 deletions
diff --git a/src/common/debug.cpp b/src/common/debug.cpp
index 42fe1f43..e09d5606 100644
--- a/src/common/debug.cpp
+++ b/src/common/debug.cpp
@@ -23,7 +23,7 @@ typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
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 @@ static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const c
#if defined(ANGLE_ENABLE_DEBUG_TRACE)
#if defined(NDEBUG)
- if (traceFileDebugOnly)
+ if (traceInDebugOnly)
{
return;
}
@@ -60,17 +60,21 @@ static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const c
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);
}
diff --git a/src/common/debug.h b/src/common/debug.h
index 0874b68e..8883ce5b 100644
--- a/src/common/debug.h
+++ b/src/common/debug.h
@@ -20,8 +20,8 @@
namespace gl
{
- // Outputs text to the debugging log
- void trace(bool traceFileDebugOnly, const char *format, ...);
+ // Outputs text to the debugging log, or the debugging window
+ void trace(bool traceInDebugOnly, const char *format, ...);
// Returns whether D3DPERF is active.
bool perfActive();