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

Unified Diff: tools/skdiff_main.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: 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) {
« include/core/SkData.h ('K') | « tools/lua/lua_pictures.cpp ('k') | tools/skdiff_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698