aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SerializationTest.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-08-02 14:40:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-02 14:40:46 -0700
commit38d909ec2875f79952de08f36adfaac5680d2c53 (patch)
treea11067146b42f3faa8531d6ef912f7246bbde1f2 /tests/SerializationTest.cpp
parentada5a44f3bdac10a8a0c53b34f5add7aea9fdbb0 (diff)
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
Diffstat (limited to 'tests/SerializationTest.cpp')
-rw-r--r--tests/SerializationTest.cpp22
1 files changed, 11 insertions, 11 deletions
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<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());