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:
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) {
private:
typedef GM INHERITED;
SkScalar y, textHeight;
- SkTypeface* prop;
- SkTypeface* mono;
+ SkTypeface* fProp;
+ SkTypeface* fMono;
};
///////////////////////////////////////////////////////////////////////////////
#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),