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
This commit is contained in:
commit-bot@chromium.org 2014-03-20 20:00:24 +00:00
parent 7225506621
commit 933e65d914
10 changed files with 5 additions and 105 deletions

View File

@ -19,7 +19,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <SkTypes.h> #include <SkTypes.h>
#include <SkTrace.h> #include <SkTraceEvent.h>
#include <SkMatrix.h> #include <SkMatrix.h>
#include <SkPoint.h> #include <SkPoint.h>
@ -522,7 +522,6 @@ static void getStrokeVerticesFromPerimeterAA(const SkTArray<Vertex, true>& perim
void PathRenderer::ConvexPathVertices(const SkPath &path, const SkStrokeRec& stroke, bool isAA, void PathRenderer::ConvexPathVertices(const SkPath &path, const SkStrokeRec& stroke, bool isAA,
const SkMatrix* transform, VertexBuffer* vertexBuffer) { const SkMatrix* transform, VertexBuffer* vertexBuffer) {
SK_TRACE_EVENT0("PathRenderer::convexPathVertices");
SkStrokeRec::Style style = stroke.getStyle(); SkStrokeRec::Style style = stroke.getStyle();
@ -598,7 +597,6 @@ static void pushToVector(SkTArray<Vertex, true>* vertices, float x, float y) {
bool PathRenderer::ConvexPathPerimeterVertices(const SkPath& path, bool forceClose, bool PathRenderer::ConvexPathPerimeterVertices(const SkPath& path, bool forceClose,
float sqrInvScaleX, float sqrInvScaleY, SkTArray<Vertex, true>* outputVertices) { float sqrInvScaleX, float sqrInvScaleY, SkTArray<Vertex, true>* outputVertices) {
SK_TRACE_EVENT0("PathRenderer::convexPathPerimeterVertices");
// TODO: to support joins other than sharp miter, join vertices should be labelled in the // TODO: to support joins other than sharp miter, join vertices should be labelled in the

View File

@ -297,7 +297,6 @@
'<(skia_include_path)/core/SkThread.h', '<(skia_include_path)/core/SkThread.h',
'<(skia_include_path)/core/SkTime.h', '<(skia_include_path)/core/SkTime.h',
'<(skia_include_path)/core/SkTLazy.h', '<(skia_include_path)/core/SkTLazy.h',
'<(skia_include_path)/core/SkTrace.h',
'<(skia_include_path)/core/SkTypeface.h', '<(skia_include_path)/core/SkTypeface.h',
'<(skia_include_path)/core/SkTypes.h', '<(skia_include_path)/core/SkTypes.h',
'<(skia_include_path)/core/SkUnPreMultiply.h', '<(skia_include_path)/core/SkUnPreMultiply.h',

View File

@ -259,7 +259,6 @@
'core/SkWriter32.h', 'core/SkWriter32.h',
'core/SkError.h', 'core/SkError.h',
'core/SkPath.h', 'core/SkPath.h',
'core/SkTrace.h',
'core/SkUnitMapper.h', 'core/SkUnitMapper.h',
'core/SkFlattenable.h', 'core/SkFlattenable.h',
'core/SkTSearch.h', 'core/SkTSearch.h',

View File

@ -139,18 +139,6 @@
//#define SK_SUPPORT_UNITTEST //#define SK_SUPPORT_UNITTEST
#endif #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. /* Change the ordering to work in X windows.
*/ */
#ifdef SK_SAMPLES_FOR_X #ifdef SK_SAMPLES_FOR_X

View File

@ -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

View File

@ -16,7 +16,7 @@
#include "GrTBackendEffectFactory.h" #include "GrTBackendEffectFactory.h"
#include "SkString.h" #include "SkString.h"
#include "SkStrokeRec.h" #include "SkStrokeRec.h"
#include "SkTrace.h" #include "SkTraceEvent.h"
#include "gl/GrGLEffect.h" #include "gl/GrGLEffect.h"
#include "gl/GrGLSL.h" #include "gl/GrGLSL.h"

View File

@ -30,7 +30,7 @@
#include "SkStrokeRec.h" #include "SkStrokeRec.h"
#include "SkTLazy.h" #include "SkTLazy.h"
#include "SkTLS.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 // 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 // InOrderDrawBuffer, to compare performance of using/not using InOrderDrawBuffer, or to make
@ -375,8 +375,6 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params,
void* srcData, void* srcData,
size_t rowBytes, size_t rowBytes,
GrResourceKey* cacheKey) { GrResourceKey* cacheKey) {
SK_TRACE_EVENT0("GrContext::createTexture");
GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheID); GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheID);
GrTexture* texture; GrTexture* texture;
@ -768,8 +766,6 @@ void GrContext::drawRect(const GrPaint& paint,
const SkRect& rect, const SkRect& rect,
const SkStrokeRec* stroke, const SkStrokeRec* stroke,
const SkMatrix* matrix) { const SkMatrix* matrix) {
SK_TRACE_EVENT0("GrContext::drawRect");
AutoRestoreEffects are; AutoRestoreEffects are;
AutoCheckFlush acf(this); AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
@ -890,7 +886,6 @@ void GrContext::drawRectToRect(const GrPaint& paint,
const SkRect& localRect, const SkRect& localRect,
const SkMatrix* dstMatrix, const SkMatrix* dstMatrix,
const SkMatrix* localMatrix) { const SkMatrix* localMatrix) {
SK_TRACE_EVENT0("GrContext::drawRectToRect");
AutoRestoreEffects are; AutoRestoreEffects are;
AutoCheckFlush acf(this); AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf); GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
@ -944,8 +939,6 @@ void GrContext::drawVertices(const GrPaint& paint,
const GrColor colors[], const GrColor colors[],
const uint16_t indices[], const uint16_t indices[],
int indexCount) { int indexCount) {
SK_TRACE_EVENT0("GrContext::drawVertices");
AutoRestoreEffects are; AutoRestoreEffects are;
AutoCheckFlush acf(this); AutoCheckFlush acf(this);
GrDrawTarget::AutoReleaseGeometry geo; // must be inside AutoCheckFlush scope 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, int left, int top, int width, int height,
GrPixelConfig config, const void* buffer, size_t rowBytes, GrPixelConfig config, const void* buffer, size_t rowBytes,
uint32_t flags) { uint32_t flags) {
SK_TRACE_EVENT0("GrContext::writeTexturePixels");
ASSERT_OWNED_RESOURCE(texture); ASSERT_OWNED_RESOURCE(texture);
if ((kUnpremul_PixelOpsFlag & flags) || !fGpu->canWriteTexturePixels(texture, config)) { 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, int left, int top, int width, int height,
GrPixelConfig config, void* buffer, size_t rowBytes, GrPixelConfig config, void* buffer, size_t rowBytes,
uint32_t flags) { uint32_t flags) {
SK_TRACE_EVENT0("GrContext::readTexturePixels");
ASSERT_OWNED_RESOURCE(texture); ASSERT_OWNED_RESOURCE(texture);
GrRenderTarget* target = texture->asRenderTarget(); GrRenderTarget* target = texture->asRenderTarget();
@ -1321,7 +1312,6 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
int left, int top, int width, int height, int left, int top, int width, int height,
GrPixelConfig dstConfig, void* buffer, size_t rowBytes, GrPixelConfig dstConfig, void* buffer, size_t rowBytes,
uint32_t flags) { uint32_t flags) {
SK_TRACE_EVENT0("GrContext::readRenderTargetPixels");
ASSERT_OWNED_RESOURCE(target); ASSERT_OWNED_RESOURCE(target);
if (NULL == target) { if (NULL == target) {
@ -1509,7 +1499,6 @@ bool GrContext::writeRenderTargetPixels(GrRenderTarget* target,
const void* buffer, const void* buffer,
size_t rowBytes, size_t rowBytes,
uint32_t flags) { uint32_t flags) {
SK_TRACE_EVENT0("GrContext::writeRenderTargetPixels");
ASSERT_OWNED_RESOURCE(target); ASSERT_OWNED_RESOURCE(target);
if (NULL == target) { if (NULL == target) {

View File

@ -13,7 +13,7 @@
#include "SkString.h" #include "SkString.h"
#include "SkStrokeRec.h" #include "SkStrokeRec.h"
#include "SkTLazy.h" #include "SkTLazy.h"
#include "SkTrace.h" #include "SkTraceEvent.h"
GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport, GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport,
@ -196,8 +196,6 @@ bool GrDefaultPathRenderer::createGeom(const SkPath& path,
int* indexCnt, int* indexCnt,
GrDrawTarget::AutoReleaseGeometry* arg) { GrDrawTarget::AutoReleaseGeometry* arg) {
{ {
SK_TRACE_EVENT0("GrDefaultPathRenderer::createGeom");
SkScalar srcSpaceTolSqd = SkScalarMul(srcSpaceTol, srcSpaceTol); SkScalar srcSpaceTolSqd = SkScalarMul(srcSpaceTol, srcSpaceTol);
int contourCnt; int contourCnt;
int maxPts = GrPathUtils::worstCasePointCount(path, &contourCnt, int maxPts = GrPathUtils::worstCasePointCount(path, &contourCnt,

View File

@ -13,7 +13,7 @@
#include "GrGpuGL.h" #include "GrGpuGL.h"
#include "GrTexture.h" #include "GrTexture.h"
#include "SkRTConf.h" #include "SkRTConf.h"
#include "SkTrace.h" #include "SkTraceEvent.h"
#define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) #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) #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) { bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) {
SK_TRACE_EVENT0("GrGLShaderBuilder::finish");
GrGLuint programId = 0; GrGLuint programId = 0;
GL_CALL_RET(programId, CreateProgram()); GL_CALL_RET(programId, CreateProgram());
if (!programId) { if (!programId) {

View File

@ -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