use unique_ptr for codec factories
Will need guards for android (at least)
Bug: skia:
Change-Id: I2bb8e656997984489ef1f2e41cd3d301c4e7b947
Reviewed-on: https://skia-review.googlesource.com/26040
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/tests/CodecAnimTest.cpp b/tests/CodecAnimTest.cpp
index 84dc9fa..612a0fa 100644
--- a/tests/CodecAnimTest.cpp
+++ b/tests/CodecAnimTest.cpp
@@ -37,9 +37,7 @@
if (!data) {
return;
}
- data = SkData::MakeSubset(data.get(), 0, 23);
- std::unique_ptr<SkCodec> codec(SkCodec::NewFromData(data));
- codec->getFrameInfo();
+ SkCodec::MakeFromData(SkData::MakeSubset(data.get(), 0, 23))->getFrameInfo();
}
// 565 does not support alpha, but there is no reason for it not to support an
@@ -50,7 +48,7 @@
if (!data) {
return;
}
- std::unique_ptr<SkCodec> codec(SkCodec::NewFromData(std::move(data)));
+ std::unique_ptr<SkCodec> codec(SkCodec::MakeFromData(std::move(data)));
auto info = codec->getInfo().makeColorType(kRGB_565_SkColorType);
SkBitmap bm;
bm.allocPixels(info);
@@ -175,7 +173,7 @@
continue;
}
- std::unique_ptr<SkCodec> codec(SkCodec::NewFromData(data));
+ std::unique_ptr<SkCodec> codec(SkCodec::MakeFromData(data));
if (!codec) {
ERRORF(r, "Failed to create an SkCodec from '%s'", rec.fName);
continue;
@@ -227,7 +225,7 @@
for (auto mode : { TestMode::kVector, TestMode::kIndividual }) {
// Re-create the codec to reset state and test parsing.
- codec.reset(SkCodec::NewFromData(data));
+ codec = SkCodec::MakeFromData(data);
int frameCount;
std::vector<SkCodec::FrameInfo> frameInfos;