Index: tools/skdiff_main.cpp |
diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp |
index bb611e96fc4baa3bcfe1173141427a2077f245c5..0c60677c5827c6e40eff129db18baa24edf5fd20 100644 |
--- a/tools/skdiff_main.cpp |
+++ b/tools/skdiff_main.cpp |
@@ -343,12 +343,12 @@ private: |
static void get_bounds(DiffResource& resource, const char* name) { |
if (resource.fBitmap.empty() && !DiffResource::isStatusFailed(resource.fStatus)) { |
- SkAutoDataUnref fileBits(read_file(resource.fFullPath.c_str())); |
- if (nullptr == fileBits) { |
+ sk_sp<SkData> fileBits(read_file(resource.fFullPath.c_str())); |
+ if (fileBits) { |
+ get_bitmap(fileBits.get(), resource, true); |
+ } else { |
SkDebugf("WARNING: couldn't read %s file <%s>\n", name, resource.fFullPath.c_str()); |
resource.fStatus = DiffResource::kCouldNotRead_Status; |
- } else { |
- get_bitmap(fileBits, resource, true); |
} |
} |
} |
@@ -472,11 +472,11 @@ static void create_diff_images (DiffMetricProc dmp, |
drp->fComparison.fFullPath = comparisonPath; |
drp->fComparison.fStatus = DiffResource::kExists_Status; |
- SkAutoDataUnref baseFileBits(read_file(drp->fBase.fFullPath.c_str())); |
+ sk_sp<SkData> baseFileBits(read_file(drp->fBase.fFullPath.c_str())); |
if (baseFileBits) { |
drp->fBase.fStatus = DiffResource::kRead_Status; |
} |
- SkAutoDataUnref comparisonFileBits(read_file(drp->fComparison.fFullPath.c_str())); |
+ sk_sp<SkData> comparisonFileBits(read_file(drp->fComparison.fFullPath.c_str())); |
if (comparisonFileBits) { |
drp->fComparison.fStatus = DiffResource::kRead_Status; |
} |
@@ -491,13 +491,13 @@ static void create_diff_images (DiffMetricProc dmp, |
} |
drp->fResult = DiffRecord::kCouldNotCompare_Result; |
- } else if (are_buffers_equal(baseFileBits, comparisonFileBits)) { |
+ } else if (are_buffers_equal(baseFileBits.get(), comparisonFileBits.get())) { |
drp->fResult = DiffRecord::kEqualBits_Result; |
VERBOSE_STATUS("MATCH", ANSI_COLOR_GREEN, baseFiles[i]); |
} else { |
AutoReleasePixels arp(drp); |
- get_bitmap(baseFileBits, drp->fBase, false); |
- get_bitmap(comparisonFileBits, drp->fComparison, false); |
+ get_bitmap(baseFileBits.get(), drp->fBase, false); |
+ get_bitmap(comparisonFileBits.get(), drp->fComparison, false); |
VERBOSE_STATUS("DIFFERENT", ANSI_COLOR_RED, baseFiles[i]); |
if (DiffResource::kDecoded_Status == drp->fBase.fStatus && |
DiffResource::kDecoded_Status == drp->fComparison.fStatus) { |