aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp6
-rw-r--r--dm/DMJsonWriter.cpp2
-rw-r--r--dm/DMSrcSink.cpp41
3 files changed, 25 insertions, 24 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 7fe6efaf89..4387fde1e1 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -304,7 +304,7 @@ static SkTHashSet<SkString> gUninterestingHashes;
static void gather_uninteresting_hashes() {
if (!FLAGS_uninterestingHashesFile.isEmpty()) {
- SkAutoTUnref<SkData> data(SkData::NewFromFileName(FLAGS_uninterestingHashesFile[0]));
+ sk_sp<SkData> data(SkData::MakeFromFileName(FLAGS_uninterestingHashesFile[0]));
if (!data) {
info("WARNING: unable to read uninteresting hashes from %s\n",
FLAGS_uninterestingHashesFile[0]);
@@ -489,12 +489,12 @@ static void push_image_gen_src(Path path, ImageGenSrc::Mode mode, SkAlphaType al
}
static void push_codec_srcs(Path path) {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
if (!encoded) {
info("Couldn't read %s.", path.c_str());
return;
}
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec.get()) {
info("Couldn't create codec for %s.", path.c_str());
return;
diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp
index 7bd8acd6d2..79f308f2ba 100644
--- a/dm/DMJsonWriter.cpp
+++ b/dm/DMJsonWriter.cpp
@@ -95,7 +95,7 @@ void JsonWriter::DumpJson() {
}
bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) {
- SkAutoTUnref<SkData> json(SkData::NewFromFileName(path));
+ sk_sp<SkData> json(SkData::MakeFromFileName(path));
if (!json) {
return false;
}
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index f4c8956b25..b6f061677c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -97,11 +97,12 @@ bool BRDSrc::veto(SinkFlags flags) const {
}
static SkBitmapRegionDecoder* create_brd(Path path) {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str()));
if (!encoded) {
return NULL;
}
- return SkBitmapRegionDecoder::Create(encoded, SkBitmapRegionDecoder::kAndroidCodec_Strategy);
+ return SkBitmapRegionDecoder::Create(encoded.get(),
+ SkBitmapRegionDecoder::kAndroidCodec_Strategy);
}
Error BRDSrc::draw(SkCanvas* canvas) const {
@@ -375,12 +376,12 @@ static void draw_to_canvas(SkCanvas* canvas, const SkImageInfo& info, void* pixe
}
Error CodecSrc::draw(SkCanvas* canvas) const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
}
@@ -627,8 +628,8 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
}
SkISize CodecSrc::size() const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -660,11 +661,11 @@ bool AndroidCodecSrc::veto(SinkFlags flags) const {
}
Error AndroidCodecSrc::draw(SkCanvas* canvas) const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
+ SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get()));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create android codec for %s.", fPath.c_str());
}
@@ -716,8 +717,8 @@ Error AndroidCodecSrc::draw(SkCanvas* canvas) const {
}
SkISize AndroidCodecSrc::size() const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
+ SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get()));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -756,7 +757,7 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
return Error::Nonfatal("Uninteresting to test image generator to 565.");
}
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
@@ -772,16 +773,16 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
SkAutoTDelete<SkImageGenerator> gen(nullptr);
switch (fMode) {
case kCodec_Mode:
- gen.reset(SkCodecImageGenerator::NewFromEncodedCodec(encoded));
+ gen.reset(SkCodecImageGenerator::NewFromEncodedCodec(encoded.get()));
if (!gen) {
return "Could not create codec image generator.";
}
break;
case kPlatform_Mode: {
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
- gen.reset(SkImageGeneratorCG::NewFromEncodedCG(encoded));
+ gen.reset(SkImageGeneratorCG::NewFromEncodedCG(encoded.get()));
#elif defined(SK_BUILD_FOR_WIN)
- gen.reset(SkImageGeneratorWIC::NewFromEncodedWIC(encoded));
+ gen.reset(SkImageGeneratorWIC::NewFromEncodedWIC(encoded.get()));
#endif
if (!gen) {
@@ -823,8 +824,8 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
}
SkISize ImageGenSrc::size() const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -857,12 +858,12 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const {
return Error::Nonfatal("F16 does not draw in legacy mode.");
}
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
}
@@ -956,8 +957,8 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const {
}
SkISize ColorCodecSrc::size() const {
- SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}