| Index: src/core/SkTypeface.cpp
|
| diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
|
| index 84cbdbfe6643b034374f97231604b1ce5b8c82a2..81038bc986e510e35922c21625b519839ae84dc0 100644
|
| --- a/src/core/SkTypeface.cpp
|
| +++ b/src/core/SkTypeface.cpp
|
| @@ -14,10 +14,26 @@
|
| #include "SkStream.h"
|
| #include "SkTypeface.h"
|
|
|
| -SkTypeface::SkTypeface(const SkFontStyle& style, SkFontID fontID, bool isFixedPitch)
|
| - : fUniqueID(fontID), fStyle(style), fIsFixedPitch(isFixedPitch) { }
|
| -
|
| -SkTypeface::~SkTypeface() { }
|
| +//#define TRACE_LIFECYCLE
|
| +
|
| +#ifdef TRACE_LIFECYCLE
|
| + static int32_t gTypefaceCounter;
|
| +#endif
|
| +
|
| +SkTypeface::SkTypeface(Style style, SkFontID fontID, bool isFixedPitch)
|
| + : fUniqueID(fontID), fStyle(style), fIsFixedPitch(isFixedPitch) {
|
| +#ifdef TRACE_LIFECYCLE
|
| + SkDebugf("SkTypeface: create %p fontID %d total %d\n",
|
| + this, fontID, ++gTypefaceCounter);
|
| +#endif
|
| +}
|
| +
|
| +SkTypeface::~SkTypeface() {
|
| +#ifdef TRACE_LIFECYCLE
|
| + SkDebugf("SkTypeface: destroy %p fontID %d total %d\n",
|
| + this, fUniqueID, --gTypefaceCounter);
|
| +#endif
|
| +}
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| @@ -27,7 +43,7 @@
|
| return SkNEW(SkEmptyTypeface);
|
| }
|
| protected:
|
| - SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
|
| + SkEmptyTypeface() : SkTypeface(SkTypeface::kNormal, 0, true) { }
|
|
|
| virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { return NULL; }
|
| virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK_OVERRIDE {
|
|
|