From 38d909ec2875f79952de08f36adfaac5680d2c53 Mon Sep 17 00:00:00 2001 From: bungeman Date: Tue, 2 Aug 2016 14:40:46 -0700 Subject: 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 --- tests/SerializationTest.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests/SerializationTest.cpp') diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index a6be1889a5..0e53ac6009 100644 --- a/tests/SerializationTest.cpp +++ b/tests/SerializationTest.cpp @@ -634,7 +634,7 @@ static sk_sp copy_picture_via_serialization(SkPicture* src) { struct AnnotationRec { const SkRect fRect; const char* fKey; - SkData* fValue; + sk_sp fValue; }; class TestAnnotationCanvas : public SkCanvas { @@ -661,7 +661,7 @@ protected: REPORTER_ASSERT(fReporter, fCurrIndex < fCount); REPORTER_ASSERT(fReporter, rect == fRec[fCurrIndex].fRect); REPORTER_ASSERT(fReporter, !strcmp(key, fRec[fCurrIndex].fKey)); - REPORTER_ASSERT(fReporter, value->equals(fRec[fCurrIndex].fValue)); + REPORTER_ASSERT(fReporter, value->equals(fRec[fCurrIndex].fValue.get())); fCurrIndex += 1; } }; @@ -676,23 +676,23 @@ DEF_TEST(Annotations, reporter) { const char* str0 = "rect-with-url"; const SkRect r0 = SkRect::MakeWH(10, 10); - SkAutoTUnref d0(SkData::NewWithCString(str0)); - SkAnnotateRectWithURL(recordingCanvas, r0, d0); + sk_sp d0(SkData::MakeWithCString(str0)); + SkAnnotateRectWithURL(recordingCanvas, r0, d0.get()); const char* str1 = "named-destination"; const SkRect r1 = SkRect::MakeXYWH(5, 5, 0, 0); // collapsed to a point - SkAutoTUnref d1(SkData::NewWithCString(str1)); - SkAnnotateNamedDestination(recordingCanvas, {r1.x(), r1.y()}, d1); + sk_sp d1(SkData::MakeWithCString(str1)); + SkAnnotateNamedDestination(recordingCanvas, {r1.x(), r1.y()}, d1.get()); const char* str2 = "link-to-destination"; const SkRect r2 = SkRect::MakeXYWH(20, 20, 5, 6); - SkAutoTUnref d2(SkData::NewWithCString(str2)); - SkAnnotateLinkToDestination(recordingCanvas, r2, d2); + sk_sp d2(SkData::MakeWithCString(str2)); + SkAnnotateLinkToDestination(recordingCanvas, r2, d2.get()); const AnnotationRec recs[] = { - { r0, SkAnnotationKeys::URL_Key(), d0 }, - { r1, SkAnnotationKeys::Define_Named_Dest_Key(), d1 }, - { r2, SkAnnotationKeys::Link_Named_Dest_Key(), d2 }, + { r0, SkAnnotationKeys::URL_Key(), std::move(d0) }, + { r1, SkAnnotationKeys::Define_Named_Dest_Key(), std::move(d1) }, + { r2, SkAnnotationKeys::Link_Named_Dest_Key(), std::move(d2) }, }; sk_sp pict0(recorder.finishRecordingAsPicture()); -- cgit v1.2.3