From 933e65d914eb86b1fbbf8ea9cf1da58ac7c42500 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 20 Mar 2014 20:00:24 +0000 Subject: [PATCH] replace old SK_TRACE_EVENT macros with new TRACE_EVENT ones, and then remove them entirely! BUG=skia:353 R=tomhudson@google.com, epoger@google.com, reed@google.com, egdaniel@google.com, bsalomon@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/196133033 git-svn-id: http://skia.googlecode.com/svn/trunk@13884 2bbb7eff-a529-9590-31e7-b0007b416f81 --- .../AndroidPathRenderer.cpp | 4 +- gyp/core.gypi | 1 - gyp/public_headers.gypi | 1 - include/config/SkUserConfig.h | 12 ----- include/core/SkTrace.h | 45 ------------------- src/gpu/GrAAConvexPathRenderer.cpp | 2 +- src/gpu/GrContext.cpp | 13 +----- src/gpu/GrDefaultPathRenderer.cpp | 4 +- src/gpu/gl/GrGLShaderBuilder.cpp | 4 +- src/utils/SkDebugTrace.h | 24 ---------- 10 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 include/core/SkTrace.h delete mode 100644 src/utils/SkDebugTrace.h diff --git a/experimental/AndroidPathRenderer/AndroidPathRenderer.cpp b/experimental/AndroidPathRenderer/AndroidPathRenderer.cpp index 6c3224863..ca9873cdd 100644 --- a/experimental/AndroidPathRenderer/AndroidPathRenderer.cpp +++ b/experimental/AndroidPathRenderer/AndroidPathRenderer.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -522,7 +522,6 @@ static void getStrokeVerticesFromPerimeterAA(const SkTArray& perim void PathRenderer::ConvexPathVertices(const SkPath &path, const SkStrokeRec& stroke, bool isAA, const SkMatrix* transform, VertexBuffer* vertexBuffer) { - SK_TRACE_EVENT0("PathRenderer::convexPathVertices"); SkStrokeRec::Style style = stroke.getStyle(); @@ -598,7 +597,6 @@ static void pushToVector(SkTArray* vertices, float x, float y) { bool PathRenderer::ConvexPathPerimeterVertices(const SkPath& path, bool forceClose, float sqrInvScaleX, float sqrInvScaleY, SkTArray* outputVertices) { - SK_TRACE_EVENT0("PathRenderer::convexPathPerimeterVertices"); // TODO: to support joins other than sharp miter, join vertices should be labelled in the diff --git a/gyp/core.gypi b/gyp/core.gypi index cdb0bab1d..e98400f3b 100644 --- a/gyp/core.gypi +++ b/gyp/core.gypi @@ -297,7 +297,6 @@ '<(skia_include_path)/core/SkThread.h', '<(skia_include_path)/core/SkTime.h', '<(skia_include_path)/core/SkTLazy.h', - '<(skia_include_path)/core/SkTrace.h', '<(skia_include_path)/core/SkTypeface.h', '<(skia_include_path)/core/SkTypes.h', '<(skia_include_path)/core/SkUnPreMultiply.h', diff --git a/gyp/public_headers.gypi b/gyp/public_headers.gypi index 61114dc0a..d14eb0b25 100644 --- a/gyp/public_headers.gypi +++ b/gyp/public_headers.gypi @@ -259,7 +259,6 @@ 'core/SkWriter32.h', 'core/SkError.h', 'core/SkPath.h', - 'core/SkTrace.h', 'core/SkUnitMapper.h', 'core/SkFlattenable.h', 'core/SkTSearch.h', diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index ec791d9a5..81033f3fa 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -139,18 +139,6 @@ //#define SK_SUPPORT_UNITTEST #endif -/* If your system embeds skia and has complex event logging, define this - symbol to name a file that maps the following macros to your system's - equivalents: - SK_TRACE_EVENT0(event) - SK_TRACE_EVENT1(event, name1, value1) - SK_TRACE_EVENT2(event, name1, value1, name2, value2) - src/utils/SkDebugTrace.h has a trivial implementation that writes to - the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined, - SkTrace.h will define the above three macros to do nothing. -*/ -//#undef SK_USER_TRACE_INCLUDE_FILE - /* Change the ordering to work in X windows. */ #ifdef SK_SAMPLES_FOR_X diff --git a/include/core/SkTrace.h b/include/core/SkTrace.h deleted file mode 100644 index e6e7e2cca..000000000 --- a/include/core/SkTrace.h +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkTrace_DEFINED -#define SkTrace_DEFINED - -#ifdef SK_USER_TRACE_INCLUDE_FILE - -/* If your system embeds skia and has complex event logging, in - src/config/SkUserConfig.h: - - define the three SK_TRACE_EVENT macros to map to your system's - equivalents, - - define the name of the include file in SK_USER_TRACE_INCLUDE_FILE - A trivial example is given in src/utils/SkDebugTrace.h. - - All arguments are const char*. Skia typically passes the name of - the object and function (and sometimes region of interest within - the function) separated by double colons for 'event'. - - SK_TRACE_EVENT1 and SK_TRACE_EVENT2 take one or two arbitrary - name-value pairs that you also want to log. SkStringPrintf() is useful - for formatting these values. - - For example: - SK_TRACE_EVENT0("GrContext::createAndLockTexture"); - SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath::renderPasses", - "verts", SkStringPrintf("%i", vert - base).c_str()); -*/ - - #include SK_USER_TRACE_INCLUDE_FILE - -#else - - #define SK_TRACE_EVENT0(event) - #define SK_TRACE_EVENT1(event, name1, value1) - #define SK_TRACE_EVENT2(event, name1, value1, name2, value2) - -#endif - -#endif diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp index a8af55999..3e1af8048 100644 --- a/src/gpu/GrAAConvexPathRenderer.cpp +++ b/src/gpu/GrAAConvexPathRenderer.cpp @@ -16,7 +16,7 @@ #include "GrTBackendEffectFactory.h" #include "SkString.h" #include "SkStrokeRec.h" -#include "SkTrace.h" +#include "SkTraceEvent.h" #include "gl/GrGLEffect.h" #include "gl/GrGLSL.h" diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index c480a1f71..c016d062a 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -30,7 +30,7 @@ #include "SkStrokeRec.h" #include "SkTLazy.h" #include "SkTLS.h" -#include "SkTrace.h" +#include "SkTraceEvent.h" // It can be useful to set this to false to test whether a bug is caused by using the // InOrderDrawBuffer, to compare performance of using/not using InOrderDrawBuffer, or to make @@ -375,8 +375,6 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params, void* srcData, size_t rowBytes, GrResourceKey* cacheKey) { - SK_TRACE_EVENT0("GrContext::createTexture"); - GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheID); GrTexture* texture; @@ -768,8 +766,6 @@ void GrContext::drawRect(const GrPaint& paint, const SkRect& rect, const SkStrokeRec* stroke, const SkMatrix* matrix) { - SK_TRACE_EVENT0("GrContext::drawRect"); - AutoRestoreEffects are; AutoCheckFlush acf(this); GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); @@ -890,7 +886,6 @@ void GrContext::drawRectToRect(const GrPaint& paint, const SkRect& localRect, const SkMatrix* dstMatrix, const SkMatrix* localMatrix) { - SK_TRACE_EVENT0("GrContext::drawRectToRect"); AutoRestoreEffects are; AutoCheckFlush acf(this); GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); @@ -944,8 +939,6 @@ void GrContext::drawVertices(const GrPaint& paint, const GrColor colors[], const uint16_t indices[], int indexCount) { - SK_TRACE_EVENT0("GrContext::drawVertices"); - AutoRestoreEffects are; AutoCheckFlush acf(this); GrDrawTarget::AutoReleaseGeometry geo; // must be inside AutoCheckFlush scope @@ -1206,7 +1199,6 @@ bool GrContext::writeTexturePixels(GrTexture* texture, int left, int top, int width, int height, GrPixelConfig config, const void* buffer, size_t rowBytes, uint32_t flags) { - SK_TRACE_EVENT0("GrContext::writeTexturePixels"); ASSERT_OWNED_RESOURCE(texture); if ((kUnpremul_PixelOpsFlag & flags) || !fGpu->canWriteTexturePixels(texture, config)) { @@ -1231,7 +1223,6 @@ bool GrContext::readTexturePixels(GrTexture* texture, int left, int top, int width, int height, GrPixelConfig config, void* buffer, size_t rowBytes, uint32_t flags) { - SK_TRACE_EVENT0("GrContext::readTexturePixels"); ASSERT_OWNED_RESOURCE(texture); GrRenderTarget* target = texture->asRenderTarget(); @@ -1321,7 +1312,6 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target, int left, int top, int width, int height, GrPixelConfig dstConfig, void* buffer, size_t rowBytes, uint32_t flags) { - SK_TRACE_EVENT0("GrContext::readRenderTargetPixels"); ASSERT_OWNED_RESOURCE(target); if (NULL == target) { @@ -1509,7 +1499,6 @@ bool GrContext::writeRenderTargetPixels(GrRenderTarget* target, const void* buffer, size_t rowBytes, uint32_t flags) { - SK_TRACE_EVENT0("GrContext::writeRenderTargetPixels"); ASSERT_OWNED_RESOURCE(target); if (NULL == target) { diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp index 1f20ac272..8d2b2b726 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -13,7 +13,7 @@ #include "SkString.h" #include "SkStrokeRec.h" #include "SkTLazy.h" -#include "SkTrace.h" +#include "SkTraceEvent.h" GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport, @@ -196,8 +196,6 @@ bool GrDefaultPathRenderer::createGeom(const SkPath& path, int* indexCnt, GrDrawTarget::AutoReleaseGeometry* arg) { { - SK_TRACE_EVENT0("GrDefaultPathRenderer::createGeom"); - SkScalar srcSpaceTolSqd = SkScalarMul(srcSpaceTol, srcSpaceTol); int contourCnt; int maxPts = GrPathUtils::worstCasePointCount(path, &contourCnt, diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp index 94568e034..f20d9368a 100644 --- a/src/gpu/gl/GrGLShaderBuilder.cpp +++ b/src/gpu/gl/GrGLShaderBuilder.cpp @@ -13,7 +13,7 @@ #include "GrGpuGL.h" #include "GrTexture.h" #include "SkRTConf.h" -#include "SkTrace.h" +#include "SkTraceEvent.h" #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) @@ -570,8 +570,6 @@ const char* GrGLShaderBuilder::enableSecondaryOutput() { } bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) { - SK_TRACE_EVENT0("GrGLShaderBuilder::finish"); - GrGLuint programId = 0; GL_CALL_RET(programId, CreateProgram()); if (!programId) { diff --git a/src/utils/SkDebugTrace.h b/src/utils/SkDebugTrace.h deleted file mode 100644 index 5ec3e1c47..000000000 --- a/src/utils/SkDebugTrace.h +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkUserTrace_DEFINED -#define SkUserTrace_DEFINED - -/* Sample implementation of SkUserTrace that routes all of the - trace macros to debug output stream. - To use this, redefine SK_USER_TRACE_INCLUDE_FILE in - include/config/SkUserConfig.h to point to this file -*/ -#define SK_TRACE_EVENT0(event) \ - SkDebugf("Trace: %s\n", event) -#define SK_TRACE_EVENT1(event, name1, value1) \ - SkDebugf("Trace: %s (%s=%s)\n", event, name1, value1) -#define SK_TRACE_EVENT2(event, name1, value1, name2, value2) \ - SkDebugf("Trace: %s (%s=%s, %s=%s)\n", event, name1, value1, name2, value2) - -#endif