diff --git a/gm/verttext2.cpp b/gm/verttext2.cpp index 9ffefec247..8491dc342b 100644 --- a/gm/verttext2.cpp +++ b/gm/verttext2.cpp @@ -21,8 +21,13 @@ public: VertText2GM() { const int pointSize = 24; textHeight = SkIntToScalar(pointSize); - prop = SkTypeface::CreateFromName("Helvetica", SkTypeface::kNormal); - mono = SkTypeface::CreateFromName("Courier New", SkTypeface::kNormal); + fProp = SkTypeface::CreateFromName("Helvetica", SkTypeface::kNormal); + fMono = SkTypeface::CreateFromName("Courier New", SkTypeface::kNormal); + } + + virtual ~VertText2GM() { + SkSafeUnref(fProp); + SkSafeUnref(fMono); } protected: @@ -47,13 +52,13 @@ protected: canvas->drawLine(0, SkIntToScalar(470), SkIntToScalar(110), SkIntToScalar(470), paint); drawText(canvas, SkString("Proportional / Top Aligned"), - prop, SkPaint::kLeft_Align); + fProp, SkPaint::kLeft_Align); drawText(canvas, SkString("< Proportional / Centered >"), - prop, SkPaint::kCenter_Align); + fProp, SkPaint::kCenter_Align); drawText(canvas, SkString("Monospaced / Top Aligned"), - mono, SkPaint::kLeft_Align); + fMono, SkPaint::kLeft_Align); drawText(canvas, SkString("< Monospaced / Centered >"), - mono, SkPaint::kCenter_Align); + fMono, SkPaint::kCenter_Align); canvas->rotate(SkIntToScalar(-15)); canvas->translate(textHeight * 4, SkIntToScalar(50)); if (i > 0) { @@ -81,8 +86,8 @@ protected: private: typedef GM INHERITED; SkScalar y, textHeight; - SkTypeface* prop; - SkTypeface* mono; + SkTypeface* fProp; + SkTypeface* fMono; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h index 87797ac4ca..dd2c1f0c4a 100644 --- a/include/utils/SkDeferredCanvas.h +++ b/include/utils/SkDeferredCanvas.h @@ -141,7 +141,12 @@ private: public: class DeviceContext : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(DeviceContext) + virtual void prepareForDraw() {} + + private: + typedef SkRefCnt INHERITED; }; public: diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h index de2af04af1..36c27caebf 100644 --- a/include/utils/SkDumpCanvas.h +++ b/include/utils/SkDumpCanvas.h @@ -49,8 +49,13 @@ public: */ class Dumper : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(Dumper) + virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[], const SkPaint*) = 0; + + private: + typedef SkRefCnt INHERITED; }; Dumper* getDumper() const { return fDumper; } diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index ac2b3cce1a..096120a962 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -13,6 +13,8 @@ #include "SkColorFilter.h" #include "SkDrawFilter.h" +SK_DEFINE_INST_COUNT(SkDeferredCanvas::DeviceContext) + namespace { bool isPaintOpaque(const SkPaint* paint, diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index 8a9ab7a28b..57ee799ea4 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -19,6 +19,8 @@ #include "SkPathEffect.h" #include "SkMaskFilter.h" +SK_DEFINE_INST_COUNT(SkDumpCanvas::Dumper) + static void toString(const SkRect& r, SkString* str) { str->printf("[%g,%g %g:%g]", SkScalarToFloat(r.fLeft), SkScalarToFloat(r.fTop), diff --git a/src/views/SkView.cpp b/src/views/SkView.cpp index 855d6a98e8..fb9df340db 100644 --- a/src/views/SkView.cpp +++ b/src/views/SkView.cpp @@ -8,6 +8,9 @@ #include "SkView.h" #include "SkCanvas.h" +SK_DEFINE_INST_COUNT(SkViewFactory) +SK_DEFINE_INST_COUNT(SkViewRegister) + //////////////////////////////////////////////////////////////////////// SkView::SkView(uint32_t flags) : fFlags(SkToU8(flags))