Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004
Review-Url: https://codereview.chromium.org/2206633004
diff --git a/include/gpu/GrResourceKey.h b/include/gpu/GrResourceKey.h
index 9f8063d..0ead35e 100644
--- a/include/gpu/GrResourceKey.h
+++ b/include/gpu/GrResourceKey.h
@@ -238,7 +238,7 @@
GrUniqueKey& operator=(const GrUniqueKey& that) {
this->INHERITED::operator=(that);
- this->setCustomData(that.getCustomData());
+ this->setCustomData(sk_ref_sp(that.getCustomData()));
return *this;
}
@@ -247,11 +247,10 @@
}
bool operator!=(const GrUniqueKey& that) const { return !(*this == that); }
- void setCustomData(const SkData* data) {
- SkSafeRef(data);
- fData.reset(data);
+ void setCustomData(sk_sp<SkData> data) {
+ fData = std::move(data);
}
- const SkData* getCustomData() const {
+ SkData* getCustomData() const {
return fData.get();
}
@@ -280,7 +279,7 @@
};
private:
- SkAutoTUnref<const SkData> fData;
+ sk_sp<SkData> fData;
};
/**