Automatically prepend "disabled-by-default-" to TRACE categories

Ensures that all Skia events are disabled by default in Chrome, and
eliminates redundant typing.

Bug: skia:
Change-Id: I289c5e5a01084fcf4cccf512da65a4727f4aeca2
Reviewed-on: https://skia-review.googlesource.com/26880
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 8189df0..a3132ba 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1677,7 +1677,7 @@
 
 void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner,
                           const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (outer.isEmpty()) {
         return;
     }
@@ -1933,7 +1933,7 @@
 }
 
 void SkCanvas::onDrawPaint(const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     this->internalDrawPaint(paint);
 }
 
@@ -1949,7 +1949,7 @@
 
 void SkCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
                             const SkPaint& paint) {
-    TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC, "count", static_cast<uint64_t>(count));
+    TRACE_EVENT1("skia", TRACE_FUNC, "count", static_cast<uint64_t>(count));
     if ((long)count <= 0) {
         return;
     }
@@ -1990,7 +1990,7 @@
 }
 
 void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkASSERT(r.isSorted());
     if (paint.canComputeFastBounds()) {
         SkRect storage;
@@ -2035,7 +2035,7 @@
 }
 
 void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkASSERT(oval.isSorted());
     if (paint.canComputeFastBounds()) {
         SkRect storage;
@@ -2056,7 +2056,7 @@
 void SkCanvas::onDrawArc(const SkRect& oval, SkScalar startAngle,
                          SkScalar sweepAngle, bool useCenter,
                          const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkASSERT(oval.isSorted());
     if (paint.canComputeFastBounds()) {
         SkRect storage;
@@ -2076,7 +2076,7 @@
 }
 
 void SkCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (paint.canComputeFastBounds()) {
         SkRect storage;
         if (this->quickReject(paint.computeFastBounds(rrect.getBounds(), &storage))) {
@@ -2121,7 +2121,7 @@
 }
 
 void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (!path.isFinite()) {
         return;
     }
@@ -2172,7 +2172,7 @@
 }
 
 void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkRect bounds = SkRect::MakeXYWH(x, y,
                                      SkIntToScalar(image->width()), SkIntToScalar(image->height()));
     if (nullptr == paint || paint->canComputeFastBounds()) {
@@ -2221,7 +2221,7 @@
 
 void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
                                const SkPaint* paint, SrcRectConstraint constraint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (nullptr == paint || paint->canComputeFastBounds()) {
         SkRect storage = dst;
         if (paint) {
@@ -2247,7 +2247,7 @@
 }
 
 void SkCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint* paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkDEBUGCODE(bitmap.validate();)
 
     if (bitmap.drawsNothing()) {
@@ -2331,14 +2331,14 @@
 
 void SkCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
                                 const SkPaint* paint, SrcRectConstraint constraint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkDEBUGCODE(bitmap.validate();)
     this->internalDrawBitmapRect(bitmap, src, dst, paint, constraint);
 }
 
 void SkCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
                                const SkPaint* paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
 
     if (nullptr == paint || paint->canComputeFastBounds()) {
         SkRect storage;
@@ -2363,7 +2363,7 @@
 
 void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
                                 const SkPaint* paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkDEBUGCODE(bitmap.validate();)
 
     if (nullptr == paint || paint->canComputeFastBounds()) {
@@ -2561,35 +2561,35 @@
 // These will become non-virtual, so they always call the (virtual) onDraw... method
 void SkCanvas::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
                         const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (byteLength) {
         this->onDrawText(text, byteLength, x, y, paint);
     }
 }
 void SkCanvas::drawPosText(const void* text, size_t byteLength, const SkPoint pos[],
                            const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (byteLength) {
         this->onDrawPosText(text, byteLength, pos, paint);
     }
 }
 void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
                             SkScalar constY, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (byteLength) {
         this->onDrawPosTextH(text, byteLength, xpos, constY, paint);
     }
 }
 void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
                               const SkMatrix* matrix, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (byteLength) {
         this->onDrawTextOnPath(text, byteLength, path, matrix, paint);
     }
 }
 void SkCanvas::drawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
                                const SkRect* cullRect, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (byteLength) {
         this->onDrawTextRSXform(text, byteLength, xform, cullRect, paint);
     }
@@ -2597,13 +2597,13 @@
 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
                             const SkPaint& paint) {
     RETURN_ON_NULL(blob);
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     this->onDrawTextBlob(blob, x, y, paint);
 }
 
 void SkCanvas::onDrawVerticesObject(const SkVertices* vertices, SkBlendMode bmode,
                                     const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr)
 
     while (iter.next()) {
@@ -2617,7 +2617,7 @@
 void SkCanvas::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
                          const SkPoint texCoords[4], SkBlendMode bmode,
                          const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (nullptr == cubics) {
         return;
     }
@@ -2707,7 +2707,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 void SkCanvas::drawColor(SkColor c, SkBlendMode mode) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkPaint paint;
 
     paint.setColor(c);
@@ -2716,13 +2716,13 @@
 }
 
 void SkCanvas::drawPoint(SkScalar x, SkScalar y, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     const SkPoint pt = { x, y };
     this->drawPoints(kPoints_PointMode, 1, &pt, paint);
 }
 
 void SkCanvas::drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkPoint pts[2];
 
     pts[0].set(x0, y0);
@@ -2731,7 +2731,7 @@
 }
 
 void SkCanvas::drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (radius < 0) {
         radius = 0;
     }
@@ -2743,7 +2743,7 @@
 
 void SkCanvas::drawRoundRect(const SkRect& r, SkScalar rx, SkScalar ry,
                              const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (rx > 0 && ry > 0) {
         SkRRect rrect;
         rrect.setRectXY(r, rx, ry);
@@ -2756,7 +2756,7 @@
 void SkCanvas::drawArc(const SkRect& oval, SkScalar startAngle,
                        SkScalar sweepAngle, bool useCenter,
                        const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (oval.isEmpty() || !sweepAngle) {
         return;
     }
@@ -2766,7 +2766,7 @@
 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength,
                                 const SkPath& path, SkScalar hOffset,
                                 SkScalar vOffset, const SkPaint& paint) {
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     SkMatrix    matrix;
 
     matrix.setTranslate(hOffset, vOffset);
@@ -2787,7 +2787,7 @@
 void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) {
     RETURN_ON_NULL(picture);
 
-    TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia"), TRACE_FUNC);
+    TRACE_EVENT0("skia", TRACE_FUNC);
     if (matrix && matrix->isIdentity()) {
         matrix = nullptr;
     }