Index: src/core/SkAdvancedTypefaceMetrics.h |
diff --git a/src/core/SkAdvancedTypefaceMetrics.h b/src/core/SkAdvancedTypefaceMetrics.h |
index 5a2180fade0364d2899bf35bbb428f71fe0259fd..b2c9ac3142d0df2fe4995b0084af2f4a6dfdccb9 100644 |
--- a/src/core/SkAdvancedTypefaceMetrics.h |
+++ b/src/core/SkAdvancedTypefaceMetrics.h |
@@ -15,35 +15,6 @@ |
#include "SkString.h" |
#include "SkTDArray.h" |
#include "SkTemplates.h" |
- |
-// Whatever std::unique_ptr Clank's using doesn't seem to work with AdvanceMetric's |
-// style of forward-declaration. Probably just a bug in an old libc++ / libstdc++. |
-// For now, hack around it with our own smart pointer. It'd be nice to clean up. |
-template <typename T> |
-class SkHackyAutoTDelete : SkNoncopyable { |
-public: |
- explicit SkHackyAutoTDelete(T* ptr = nullptr) : fPtr(ptr) {} |
- ~SkHackyAutoTDelete() { delete fPtr; } |
- |
- T* get() const { return fPtr; } |
- T* operator->() const { return fPtr; } |
- |
- void reset(T* ptr) { |
- if (ptr != fPtr) { |
- delete fPtr; |
- fPtr = ptr; |
- } |
- } |
- void free() { this->reset(nullptr); } |
- T* detach() { |
- T* ptr = fPtr; |
- fPtr = nullptr; |
- return ptr; |
- } |
- |
-private: |
- T* fPtr; |
-}; |
/** \class SkAdvancedTypefaceMetrics |
@@ -126,7 +97,7 @@ |
uint16_t fStartId; |
uint16_t fEndId; |
SkTDArray<Data> fAdvance; |
- SkHackyAutoTDelete<AdvanceMetric<Data> > fNext; |
+ SkAutoTDelete<AdvanceMetric<Data> > fNext; |
}; |
struct VerticalMetric { |
@@ -159,9 +130,9 @@ |
void resetRange(SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* range, |
int startId); |
-template <typename Data, template<typename> class AutoTDelete> |
+template <typename Data> |
SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* appendRange( |
- AutoTDelete<SkAdvancedTypefaceMetrics::AdvanceMetric<Data> >* nextSlot, |
+ SkAutoTDelete<SkAdvancedTypefaceMetrics::AdvanceMetric<Data> >* nextSlot, |
int startId); |
template <typename Data> |