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: #include "SkDumpCanvas.h" michael@0: michael@0: #ifdef SK_DEVELOPER michael@0: #include "SkPicture.h" michael@0: #include "SkPixelRef.h" michael@0: #include "SkRRect.h" michael@0: #include "SkString.h" michael@0: #include michael@0: #include michael@0: michael@0: // needed just to know that these are all subclassed from SkFlattenable michael@0: #include "SkShader.h" michael@0: #include "SkPathEffect.h" michael@0: #include "SkXfermode.h" michael@0: #include "SkColorFilter.h" michael@0: #include "SkPathEffect.h" michael@0: #include "SkMaskFilter.h" michael@0: michael@0: static void toString(const SkRect& r, SkString* str) { michael@0: str->appendf("[%g,%g %g:%g]", michael@0: SkScalarToFloat(r.fLeft), SkScalarToFloat(r.fTop), michael@0: SkScalarToFloat(r.width()), SkScalarToFloat(r.height())); michael@0: } michael@0: michael@0: static void toString(const SkIRect& r, SkString* str) { michael@0: str->appendf("[%d,%d %d:%d]", r.fLeft, r.fTop, r.width(), r.height()); michael@0: } michael@0: michael@0: static void toString(const SkRRect& rrect, SkString* str) { michael@0: SkRect r = rrect.getBounds(); michael@0: str->appendf("[%g,%g %g:%g]", michael@0: SkScalarToFloat(r.fLeft), SkScalarToFloat(r.fTop), michael@0: SkScalarToFloat(r.width()), SkScalarToFloat(r.height())); michael@0: if (rrect.isOval()) { michael@0: str->append("()"); michael@0: } else if (rrect.isSimple()) { michael@0: const SkVector& rad = rrect.getSimpleRadii(); michael@0: str->appendf("(%g,%g)", rad.x(), rad.y()); michael@0: } else if (rrect.isComplex()) { michael@0: SkVector radii[4] = { michael@0: rrect.radii(SkRRect::kUpperLeft_Corner), michael@0: rrect.radii(SkRRect::kUpperRight_Corner), michael@0: rrect.radii(SkRRect::kLowerRight_Corner), michael@0: rrect.radii(SkRRect::kLowerLeft_Corner), michael@0: }; michael@0: str->appendf("(%g,%g %g,%g %g,%g %g,%g)", michael@0: radii[0].x(), radii[0].y(), michael@0: radii[1].x(), radii[1].y(), michael@0: radii[2].x(), radii[2].y(), michael@0: radii[3].x(), radii[3].y()); michael@0: } michael@0: } michael@0: michael@0: static void dumpVerbs(const SkPath& path, SkString* str) { michael@0: SkPath::Iter iter(path, false); michael@0: SkPoint pts[4]; michael@0: for (;;) { michael@0: switch (iter.next(pts, false)) { michael@0: case SkPath::kMove_Verb: michael@0: str->appendf(" M%g,%g", pts[0].fX, pts[0].fY); michael@0: break; michael@0: case SkPath::kLine_Verb: michael@0: str->appendf(" L%g,%g", pts[0].fX, pts[0].fY); michael@0: break; michael@0: case SkPath::kQuad_Verb: michael@0: str->appendf(" Q%g,%g,%g,%g", pts[1].fX, pts[1].fY, michael@0: pts[2].fX, pts[2].fY); michael@0: break; michael@0: case SkPath::kCubic_Verb: michael@0: str->appendf(" C%g,%g,%g,%g,%g,%g", pts[1].fX, pts[1].fY, michael@0: pts[2].fX, pts[2].fY, pts[3].fX, pts[3].fY); michael@0: break; michael@0: case SkPath::kClose_Verb: michael@0: str->append("X"); michael@0: break; michael@0: case SkPath::kDone_Verb: michael@0: return; michael@0: case SkPath::kConic_Verb: michael@0: SkASSERT(0); michael@0: break; michael@0: } michael@0: } michael@0: } michael@0: michael@0: static void toString(const SkPath& path, SkString* str) { michael@0: if (path.isEmpty()) { michael@0: str->append("path:empty"); michael@0: } else { michael@0: toString(path.getBounds(), str); michael@0: #if 1 michael@0: SkString s; michael@0: dumpVerbs(path, &s); michael@0: str->append(s.c_str()); michael@0: #endif michael@0: str->append("]"); michael@0: str->prepend("path:["); michael@0: } michael@0: } michael@0: michael@0: static const char* toString(SkRegion::Op op) { michael@0: static const char* gOpNames[] = { michael@0: "DIFF", "SECT", "UNION", "XOR", "RDIFF", "REPLACE" michael@0: }; michael@0: return gOpNames[op]; michael@0: } michael@0: michael@0: static void toString(const SkRegion& rgn, SkString* str) { michael@0: str->append("Region:["); michael@0: toString(rgn.getBounds(), str); michael@0: str->append("]"); michael@0: if (rgn.isComplex()) { michael@0: str->append(".complex"); michael@0: } michael@0: } michael@0: michael@0: static const char* toString(SkCanvas::VertexMode vm) { michael@0: static const char* gVMNames[] = { michael@0: "TRIANGLES", "STRIP", "FAN" michael@0: }; michael@0: return gVMNames[vm]; michael@0: } michael@0: michael@0: static const char* toString(SkCanvas::PointMode pm) { michael@0: static const char* gPMNames[] = { michael@0: "POINTS", "LINES", "POLYGON" michael@0: }; michael@0: return gPMNames[pm]; michael@0: } michael@0: michael@0: static void toString(const void* text, size_t byteLen, SkPaint::TextEncoding enc, michael@0: SkString* str) { michael@0: // FIXME: this code appears to be untested - and probably unused - and probably wrong michael@0: switch (enc) { michael@0: case SkPaint::kUTF8_TextEncoding: michael@0: str->appendf("\"%.*s\"%s", (int)SkTMax(byteLen, 32), (const char*) text, michael@0: byteLen > 32 ? "..." : ""); michael@0: break; michael@0: case SkPaint::kUTF16_TextEncoding: michael@0: str->appendf("\"%.*ls\"%s", (int)SkTMax(byteLen, 32), (const wchar_t*) text, michael@0: byteLen > 64 ? "..." : ""); michael@0: break; michael@0: case SkPaint::kUTF32_TextEncoding: michael@0: str->appendf("\"%.*ls\"%s", (int)SkTMax(byteLen, 32), (const wchar_t*) text, michael@0: byteLen > 128 ? "..." : ""); michael@0: break; michael@0: case SkPaint::kGlyphID_TextEncoding: michael@0: str->append(""); michael@0: break; michael@0: michael@0: default: michael@0: SkASSERT(false); michael@0: break; michael@0: } michael@0: } michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: #define WIDE_OPEN 16384 michael@0: michael@0: SkDumpCanvas::SkDumpCanvas(Dumper* dumper) : INHERITED(WIDE_OPEN, WIDE_OPEN) { michael@0: fNestLevel = 0; michael@0: SkSafeRef(dumper); michael@0: fDumper = dumper; michael@0: } michael@0: michael@0: SkDumpCanvas::~SkDumpCanvas() { michael@0: SkSafeUnref(fDumper); michael@0: } michael@0: michael@0: void SkDumpCanvas::dump(Verb verb, const SkPaint* paint, michael@0: const char format[], ...) { michael@0: static const size_t BUFFER_SIZE = 1024; michael@0: michael@0: char buffer[BUFFER_SIZE]; michael@0: va_list args; michael@0: va_start(args, format); michael@0: vsnprintf(buffer, BUFFER_SIZE, format, args); michael@0: va_end(args); michael@0: michael@0: if (fDumper) { michael@0: fDumper->dump(this, verb, buffer, paint); michael@0: } michael@0: } michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: void SkDumpCanvas::willSave(SaveFlags flags) { michael@0: this->dump(kSave_Verb, NULL, "save(0x%X)", flags); michael@0: this->INHERITED::willSave(flags); michael@0: } michael@0: michael@0: SkCanvas::SaveLayerStrategy SkDumpCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint, michael@0: SaveFlags flags) { michael@0: SkString str; michael@0: str.printf("saveLayer(0x%X)", flags); michael@0: if (bounds) { michael@0: str.append(" bounds"); michael@0: toString(*bounds, &str); michael@0: } michael@0: if (paint) { michael@0: if (paint->getAlpha() != 0xFF) { michael@0: str.appendf(" alpha:0x%02X", paint->getAlpha()); michael@0: } michael@0: if (paint->getXfermode()) { michael@0: str.appendf(" xfermode:%p", paint->getXfermode()); michael@0: } michael@0: } michael@0: this->dump(kSave_Verb, paint, str.c_str()); michael@0: return this->INHERITED::willSaveLayer(bounds, paint, flags); michael@0: } michael@0: michael@0: void SkDumpCanvas::willRestore() { michael@0: this->dump(kRestore_Verb, NULL, "restore"); michael@0: this->INHERITED::willRestore(); michael@0: } michael@0: michael@0: void SkDumpCanvas::didTranslate(SkScalar dx, SkScalar dy) { michael@0: this->dump(kMatrix_Verb, NULL, "translate(%g %g)", michael@0: SkScalarToFloat(dx), SkScalarToFloat(dy)); michael@0: this->INHERITED::didTranslate(dx, dy); michael@0: } michael@0: michael@0: void SkDumpCanvas::didScale(SkScalar sx, SkScalar sy) { michael@0: this->dump(kMatrix_Verb, NULL, "scale(%g %g)", michael@0: SkScalarToFloat(sx), SkScalarToFloat(sy)); michael@0: this->INHERITED::didScale(sx, sy); michael@0: } michael@0: michael@0: void SkDumpCanvas::didRotate(SkScalar degrees) { michael@0: this->dump(kMatrix_Verb, NULL, "rotate(%g)", SkScalarToFloat(degrees)); michael@0: this->INHERITED::didRotate(degrees); michael@0: } michael@0: michael@0: void SkDumpCanvas::didSkew(SkScalar sx, SkScalar sy) { michael@0: this->dump(kMatrix_Verb, NULL, "skew(%g %g)", michael@0: SkScalarToFloat(sx), SkScalarToFloat(sy)); michael@0: this->INHERITED::didSkew(sx, sy); michael@0: } michael@0: michael@0: void SkDumpCanvas::didConcat(const SkMatrix& matrix) { michael@0: SkString str; michael@0: matrix.toString(&str); michael@0: this->dump(kMatrix_Verb, NULL, "concat(%s)", str.c_str()); michael@0: this->INHERITED::didConcat(matrix); michael@0: } michael@0: michael@0: void SkDumpCanvas::didSetMatrix(const SkMatrix& matrix) { michael@0: SkString str; michael@0: matrix.toString(&str); michael@0: this->dump(kMatrix_Verb, NULL, "setMatrix(%s)", str.c_str()); michael@0: this->INHERITED::didSetMatrix(matrix); michael@0: } michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: const char* SkDumpCanvas::EdgeStyleToAAString(ClipEdgeStyle edgeStyle) { michael@0: return kSoft_ClipEdgeStyle == edgeStyle ? "AA" : "BW"; michael@0: } michael@0: michael@0: void SkDumpCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { michael@0: SkString str; michael@0: toString(rect, &str); michael@0: this->dump(kClip_Verb, NULL, "clipRect(%s %s %s)", str.c_str(), toString(op), michael@0: EdgeStyleToAAString(edgeStyle)); michael@0: this->INHERITED::onClipRect(rect, op, edgeStyle); michael@0: } michael@0: michael@0: void SkDumpCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { michael@0: SkString str; michael@0: toString(rrect, &str); michael@0: this->dump(kClip_Verb, NULL, "clipRRect(%s %s %s)", str.c_str(), toString(op), michael@0: EdgeStyleToAAString(edgeStyle)); michael@0: this->INHERITED::onClipRRect(rrect, op, edgeStyle); michael@0: } michael@0: michael@0: void SkDumpCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { michael@0: SkString str; michael@0: toString(path, &str); michael@0: this->dump(kClip_Verb, NULL, "clipPath(%s %s %s)", str.c_str(), toString(op), michael@0: EdgeStyleToAAString(edgeStyle)); michael@0: this->INHERITED::onClipPath(path, op, edgeStyle); michael@0: } michael@0: michael@0: void SkDumpCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { michael@0: SkString str; michael@0: toString(deviceRgn, &str); michael@0: this->dump(kClip_Verb, NULL, "clipRegion(%s %s)", str.c_str(), michael@0: toString(op)); michael@0: this->INHERITED::onClipRegion(deviceRgn, op); michael@0: } michael@0: michael@0: void SkDumpCanvas::onPushCull(const SkRect& cullRect) { michael@0: SkString str; michael@0: toString(cullRect, &str); michael@0: this->dump(kCull_Verb, NULL, "pushCull(%s)", str.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::onPopCull() { michael@0: this->dump(kCull_Verb, NULL, "popCull()"); michael@0: } michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: void SkDumpCanvas::drawPaint(const SkPaint& paint) { michael@0: this->dump(kDrawPaint_Verb, &paint, "drawPaint()"); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawPoints(PointMode mode, size_t count, michael@0: const SkPoint pts[], const SkPaint& paint) { michael@0: this->dump(kDrawPoints_Verb, &paint, "drawPoints(%s, %d)", toString(mode), michael@0: count); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawOval(const SkRect& rect, const SkPaint& paint) { michael@0: SkString str; michael@0: toString(rect, &str); michael@0: this->dump(kDrawOval_Verb, &paint, "drawOval(%s)", str.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { michael@0: SkString str; michael@0: toString(rect, &str); michael@0: this->dump(kDrawRect_Verb, &paint, "drawRect(%s)", str.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { michael@0: SkString str; michael@0: toString(rrect, &str); michael@0: this->dump(kDrawDRRect_Verb, &paint, "drawRRect(%s)", str.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, michael@0: const SkPaint& paint) { michael@0: SkString str0, str1; michael@0: toString(outer, &str0); michael@0: toString(inner, &str0); michael@0: this->dump(kDrawRRect_Verb, &paint, "drawDRRect(%s,%s)", michael@0: str0.c_str(), str1.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawPath(const SkPath& path, const SkPaint& paint) { michael@0: SkString str; michael@0: toString(path, &str); michael@0: this->dump(kDrawPath_Verb, &paint, "drawPath(%s)", str.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, michael@0: const SkPaint* paint) { michael@0: SkString str; michael@0: bitmap.toString(&str); michael@0: this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(), michael@0: SkScalarToFloat(x), SkScalarToFloat(y)); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, michael@0: const SkRect& dst, const SkPaint* paint, michael@0: DrawBitmapRectFlags flags) { michael@0: SkString bs, rs; michael@0: bitmap.toString(&bs); michael@0: toString(dst, &rs); michael@0: // show the src-rect only if its not everything michael@0: if (src && (src->fLeft > 0 || src->fTop > 0 || michael@0: src->fRight < SkIntToScalar(bitmap.width()) || michael@0: src->fBottom < SkIntToScalar(bitmap.height()))) { michael@0: SkString ss; michael@0: toString(*src, &ss); michael@0: rs.prependf("%s ", ss.c_str()); michael@0: } michael@0: michael@0: this->dump(kDrawBitmap_Verb, paint, "drawBitmapRectToRect(%s %s)", michael@0: bs.c_str(), rs.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, michael@0: const SkPaint* paint) { michael@0: SkString bs, ms; michael@0: bitmap.toString(&bs); michael@0: m.toString(&ms); michael@0: this->dump(kDrawBitmap_Verb, paint, "drawBitmapMatrix(%s %s)", michael@0: bs.c_str(), ms.c_str()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, michael@0: const SkPaint* paint) { michael@0: SkString str; michael@0: bitmap.toString(&str); michael@0: this->dump(kDrawBitmap_Verb, paint, "drawSprite(%s %d %d)", str.c_str(), michael@0: x, y); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawText(const void* text, size_t byteLength, SkScalar x, michael@0: SkScalar y, const SkPaint& paint) { michael@0: SkString str; michael@0: toString(text, byteLength, paint.getTextEncoding(), &str); michael@0: this->dump(kDrawText_Verb, &paint, "drawText(%s [%d] %g %g)", str.c_str(), michael@0: byteLength, SkScalarToFloat(x), SkScalarToFloat(y)); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawPosText(const void* text, size_t byteLength, michael@0: const SkPoint pos[], const SkPaint& paint) { michael@0: SkString str; michael@0: toString(text, byteLength, paint.getTextEncoding(), &str); michael@0: this->dump(kDrawText_Verb, &paint, "drawPosText(%s [%d] %g %g ...)", michael@0: str.c_str(), byteLength, SkScalarToFloat(pos[0].fX), michael@0: SkScalarToFloat(pos[0].fY)); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawPosTextH(const void* text, size_t byteLength, michael@0: const SkScalar xpos[], SkScalar constY, michael@0: const SkPaint& paint) { michael@0: SkString str; michael@0: toString(text, byteLength, paint.getTextEncoding(), &str); michael@0: this->dump(kDrawText_Verb, &paint, "drawPosTextH(%s [%d] %g %g ...)", michael@0: str.c_str(), byteLength, SkScalarToFloat(xpos[0]), michael@0: SkScalarToFloat(constY)); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawTextOnPath(const void* text, size_t byteLength, michael@0: const SkPath& path, const SkMatrix* matrix, michael@0: const SkPaint& paint) { michael@0: SkString str; michael@0: toString(text, byteLength, paint.getTextEncoding(), &str); michael@0: this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])", michael@0: str.c_str(), byteLength); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawPicture(SkPicture& picture) { michael@0: this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", &picture, michael@0: picture.width(), picture.height()); michael@0: fNestLevel += 1; michael@0: this->INHERITED::drawPicture(picture); michael@0: fNestLevel -= 1; michael@0: this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, michael@0: picture.width(), picture.height()); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, michael@0: const SkPoint vertices[], const SkPoint texs[], michael@0: const SkColor colors[], SkXfermode* xmode, michael@0: const uint16_t indices[], int indexCount, michael@0: const SkPaint& paint) { michael@0: this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", michael@0: toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), michael@0: SkScalarToFloat(vertices[0].fY)); michael@0: } michael@0: michael@0: void SkDumpCanvas::drawData(const void* data, size_t length) { michael@0: // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length); michael@0: this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length, michael@0: SkTMin(length, 64), data); michael@0: } michael@0: michael@0: void SkDumpCanvas::beginCommentGroup(const char* description) { michael@0: this->dump(kBeginCommentGroup_Verb, NULL, "beginCommentGroup(%s)", description); michael@0: } michael@0: michael@0: void SkDumpCanvas::addComment(const char* kywd, const char* value) { michael@0: this->dump(kAddComment_Verb, NULL, "addComment(%s, %s)", kywd, value); michael@0: } michael@0: michael@0: void SkDumpCanvas::endCommentGroup() { michael@0: this->dump(kEndCommentGroup_Verb, NULL, "endCommentGroup()"); michael@0: } michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: SkFormatDumper::SkFormatDumper(void (*proc)(const char*, void*), void* refcon) { michael@0: fProc = proc; michael@0: fRefcon = refcon; michael@0: } michael@0: michael@0: static void appendPtr(SkString* str, const void* ptr, const char name[]) { michael@0: if (ptr) { michael@0: str->appendf(" %s:%p", name, ptr); michael@0: } michael@0: } michael@0: michael@0: static void appendFlattenable(SkString* str, const SkFlattenable* ptr, michael@0: const char name[]) { michael@0: if (ptr) { michael@0: str->appendf(" %s:%p", name, ptr); michael@0: } michael@0: } michael@0: michael@0: void SkFormatDumper::dump(SkDumpCanvas* canvas, SkDumpCanvas::Verb verb, michael@0: const char str[], const SkPaint* p) { michael@0: SkString msg, tab; michael@0: const int level = canvas->getNestLevel() + canvas->getSaveCount() - 1; michael@0: SkASSERT(level >= 0); michael@0: for (int i = 0; i < level; i++) { michael@0: #if 0 michael@0: tab.append("\t"); michael@0: #else michael@0: tab.append(" "); // tabs are often too wide to be useful michael@0: #endif michael@0: } michael@0: msg.printf("%s%s", tab.c_str(), str); michael@0: michael@0: if (p) { michael@0: msg.appendf(" color:0x%08X flags:%X", p->getColor(), p->getFlags()); michael@0: appendFlattenable(&msg, p->getShader(), "shader"); michael@0: appendFlattenable(&msg, p->getXfermode(), "xfermode"); michael@0: appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); michael@0: appendFlattenable(&msg, p->getMaskFilter(), "maskFilter"); michael@0: appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); michael@0: appendFlattenable(&msg, p->getColorFilter(), "filter"); michael@0: michael@0: if (SkDumpCanvas::kDrawText_Verb == verb) { michael@0: msg.appendf(" textSize:%g", SkScalarToFloat(p->getTextSize())); michael@0: appendPtr(&msg, p->getTypeface(), "typeface"); michael@0: } michael@0: michael@0: if (p->getStyle() != SkPaint::kFill_Style) { michael@0: msg.appendf(" strokeWidth:%g", SkScalarToFloat(p->getStrokeWidth())); michael@0: } michael@0: } michael@0: michael@0: fProc(msg.c_str(), fRefcon); michael@0: } michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: static void dumpToDebugf(const char text[], void*) { michael@0: SkDebugf("%s\n", text); michael@0: } michael@0: michael@0: SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} michael@0: michael@0: #endif