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

Unified Diff: dm/DMSrcSink.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 years, 3 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
« no previous file with comments | « dm/DM.cpp ('k') | fuzz/Fuzz.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index fcc4a33a1aa22249080bb65ed3bd58978a2e44f6..c3c8a7bc6e9b6a4bfd5c2298fc626c7cce25153f 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -104,8 +104,7 @@ static SkBitmapRegionDecoder* create_brd(Path path) {
if (!encoded) {
return NULL;
}
- return SkBitmapRegionDecoder::Create(encoded.get(),
- SkBitmapRegionDecoder::kAndroidCodec_Strategy);
+ return SkBitmapRegionDecoder::Create(encoded, SkBitmapRegionDecoder::kAndroidCodec_Strategy);
}
Error BRDSrc::draw(SkCanvas* canvas) const {
@@ -384,7 +383,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
}
@@ -632,7 +631,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkISize CodecSrc::size() const {
sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -668,7 +667,7 @@ Error AndroidCodecSrc::draw(SkCanvas* canvas) const {
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create android codec for %s.", fPath.c_str());
}
@@ -721,7 +720,7 @@ Error AndroidCodecSrc::draw(SkCanvas* canvas) const {
SkISize AndroidCodecSrc::size() const {
sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
- SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -828,7 +827,7 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
SkISize ImageGenSrc::size() const {
sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
@@ -873,7 +872,7 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (nullptr == codec.get()) {
return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
}
@@ -979,7 +978,7 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const {
SkISize ColorCodecSrc::size() const {
sk_sp<SkData> encoded(SkData::MakeFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get()));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (nullptr == codec) {
return SkISize::Make(0, 0);
}
« no previous file with comments | « dm/DM.cpp ('k') | fuzz/Fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698