Don't call gl::output unless perf is enabled.

gl::output allocates a pretty large stack buffer, so it has to call _chkstk. This is rather slow, so avoid calling gl::output if perf and tracing are disabled.

BUG=

Review URL: https://codereview.appspot.com/6843043

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1471 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/debug.cpp b/src/common/debug.cpp
index b2238f9..c45b2a1 100644
--- a/src/common/debug.cpp
+++ b/src/common/debug.cpp
@@ -84,6 +84,12 @@
 ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
 {
 #if !defined(ANGLE_DISABLE_PERF)
+#if defined(ANGLE_DISABLE_TRACE)
+    if (!perfActive())
+    {
+        return;
+    }
+#endif
     va_list vararg;
     va_start(vararg, format);
     output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);