michael@0: michael@0: /* michael@0: * Copyright 2011 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkTrace_DEFINED michael@0: #define SkTrace_DEFINED michael@0: michael@0: #ifdef SK_USER_TRACE_INCLUDE_FILE michael@0: michael@0: /* If your system embeds skia and has complex event logging, in michael@0: src/config/SkUserConfig.h: michael@0: - define the three SK_TRACE_EVENT macros to map to your system's michael@0: equivalents, michael@0: - define the name of the include file in SK_USER_TRACE_INCLUDE_FILE michael@0: A trivial example is given in src/utils/SkDebugTrace.h. michael@0: michael@0: All arguments are const char*. Skia typically passes the name of michael@0: the object and function (and sometimes region of interest within michael@0: the function) separated by double colons for 'event'. michael@0: michael@0: SK_TRACE_EVENT1 and SK_TRACE_EVENT2 take one or two arbitrary michael@0: name-value pairs that you also want to log. SkStringPrintf() is useful michael@0: for formatting these values. michael@0: michael@0: For example: michael@0: SK_TRACE_EVENT0("GrContext::createAndLockTexture"); michael@0: SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath::renderPasses", michael@0: "verts", SkStringPrintf("%i", vert - base).c_str()); michael@0: */ michael@0: michael@0: #include SK_USER_TRACE_INCLUDE_FILE michael@0: michael@0: #else michael@0: michael@0: #define SK_TRACE_EVENT0(event) michael@0: #define SK_TRACE_EVENT1(event, name1, value1) michael@0: #define SK_TRACE_EVENT2(event, name1, value1, name2, value2) michael@0: michael@0: #endif michael@0: michael@0: #endif