gfx/angle/src/compiler/compilerdebug.cpp
author Matt Woodrow <mwoodrow@mozilla.com>
Tue, 12 Apr 2011 00:36:13 -0700
changeset 68003 48d6abe0a436684ba33e958303d27426480a27ba
parent 67999 133a3c3ac1fe73ca4892644e7f13bbf71854a0f6
child 100555 20db7c6d82cc5bcb0e916bfe72d1ab04d3c3be2d
permissions -rw-r--r--
Bug 640082 followup - Fix typo that caused all black rendering with accelerated layers on X. r=bjacob

//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// compilerdebug.cpp: Debugging utilities.

#include "compiler/compilerdebug.h"

#include <stdarg.h>
#include <stdio.h>

#include "compiler/ParseHelper.h"

static const int kTraceBufferLen = 1024;

#ifdef TRACE_ENABLED
extern "C" {
void Trace(const char *format, ...) {
    if (!format) return;

    TParseContext* parseContext = GetGlobalParseContext();
    if (parseContext) {
        char buf[kTraceBufferLen];
        va_list args;
        va_start(args, format);
        vsnprintf(buf, kTraceBufferLen, format, args);
        va_end(args);

        parseContext->infoSink.debug << buf;
    }
}
}  // extern "C"
#endif  // TRACE_ENABLED