sk_make_sp<T>()
because auto atm = sk_make_sp<SkAdvancedTypefaceMetrics>(); is better than sk_sp<SkAdvancedTypefaceMetrics> atm(new SkAdvancedTypefaceMetrics); GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1753973002 Review URL: https://codereview.chromium.org/1753973002
This commit is contained in:
parent
7349490991
commit
217c0b3f13
@ -11,6 +11,7 @@
|
||||
#include "../private/SkAtomics.h"
|
||||
#include "../private/SkUniquePtr.h"
|
||||
#include "SkTypes.h"
|
||||
#include <utility>
|
||||
|
||||
/** \class SkRefCntBase
|
||||
|
||||
@ -326,4 +327,9 @@ private:
|
||||
T* fPtr;
|
||||
};
|
||||
|
||||
template <typename T, typename... Args>
|
||||
sk_sp<T> sk_make_sp(Args&&... args) {
|
||||
return sk_sp<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
};
|
||||
|
||||
static sk_sp<Effect> Create() {
|
||||
return sk_sp<Effect>(new Effect);
|
||||
return sk_make_sp<Effect>();
|
||||
}
|
||||
|
||||
class Paint {
|
||||
|
Loading…
Reference in New Issue
Block a user