Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1789)

Unified Diff: tests/PDFJpegEmbedTest.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/PDFJpegEmbedTest.cpp
diff --git a/tests/PDFJpegEmbedTest.cpp b/tests/PDFJpegEmbedTest.cpp
index 5ef4a2dbfc3c2435b1f8fb27cf2bddbb8a48ea92..6b10f04932c65c820f0ce5d4d8233dc47472da74 100644
--- a/tests/PDFJpegEmbedTest.cpp
+++ b/tests/PDFJpegEmbedTest.cpp
@@ -38,10 +38,10 @@ static bool is_subset_of(SkData* smaller, SkData* larger) {
}
-static SkData* load_resource(
+static sk_sp<SkData> load_resource(
skiatest::Reporter* r, const char* test, const char* filename) {
SkString path(GetResourcePath(filename));
- SkData* data = SkData::NewFromFileName(path.c_str());
+ sk_sp<SkData> data(SkData::MakeFromFileName(path.c_str()));
if (!data) {
INFOF(r, "\n%s: Resource '%s' can not be found.\n",
test, filename);
@@ -124,13 +124,12 @@ DEF_TEST(JpegIdentification, r) {
{"mandrill_512_q075.jpg", true, SkJFIFInfo::kYCbCr},
{"randPixels.jpg", true, SkJFIFInfo::kYCbCr}};
for (size_t i = 0; i < SK_ARRAY_COUNT(kTests); ++i) {
- SkAutoTUnref<SkData> data(
- load_resource(r, "JpegIdentification", kTests[i].path));
+ sk_sp<SkData> data(load_resource(r, "JpegIdentification", kTests[i].path));
if (!data) {
continue;
}
SkJFIFInfo info;
- bool isJfif = SkIsJFIF(data, &info);
+ bool isJfif = SkIsJFIF(data.get(), &info);
if (isJfif != kTests[i].isJfif) {
ERRORF(r, "%s failed isJfif test", kTests[i].path);
continue;

Powered by Google App Engine
This is Rietveld 408576698