Index: tests/SerializationTest.cpp |
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp |
index a6be1889a560bbbb58725e567b8823ee0c375196..0e53ac6009aec6e92c67b09a5f28f9e356aca334 100644 |
--- a/tests/SerializationTest.cpp |
+++ b/tests/SerializationTest.cpp |
@@ -634,7 +634,7 @@ static sk_sp<SkPicture> copy_picture_via_serialization(SkPicture* src) { |
struct AnnotationRec { |
const SkRect fRect; |
const char* fKey; |
- SkData* fValue; |
+ sk_sp<SkData> 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<SkData> d0(SkData::NewWithCString(str0)); |
- SkAnnotateRectWithURL(recordingCanvas, r0, d0); |
+ sk_sp<SkData> 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<SkData> d1(SkData::NewWithCString(str1)); |
- SkAnnotateNamedDestination(recordingCanvas, {r1.x(), r1.y()}, d1); |
+ sk_sp<SkData> 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<SkData> d2(SkData::NewWithCString(str2)); |
- SkAnnotateLinkToDestination(recordingCanvas, r2, d2); |
+ sk_sp<SkData> 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<SkPicture> pict0(recorder.finishRecordingAsPicture()); |