Fix calls to deprecated Wuffs API

In the latest Wuffs' terminology, "null_foo" refers to an unusable foo
and "empty_foo" refers to a usable but zero-sized foo.

Bug: skia:8235
Change-Id: I7ac7128a0b370b2d32b5d35f13643d49c519eaca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243597
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This commit is contained in:
Nigel Tao 2019-09-25 11:08:42 +10:00 committed by Skia Commit-Bot
parent 1cb574390e
commit 96c10a0a8f

View File

@ -267,7 +267,7 @@ SkWuffsCodec::SkWuffsCodec(SkEncodedInfo&&
fFirstFrameIOPosition(imgcfg.first_frame_io_position()),
fFrameConfig(wuffs_base__null_frame_config()),
fPixelBuffer(pixbuf),
fIOBuffer(wuffs_base__null_io_buffer()),
fIOBuffer(wuffs_base__empty_io_buffer()),
fIncrDecDst(nullptr),
fIncrDecRowBytes(0),
fFirstCallToIncrementalDecode(false),
@ -712,7 +712,7 @@ SkCodec::Result SkWuffsCodec::resetDecoder() {
if (!fStream->rewind()) {
return SkCodec::kInternalError;
}
fIOBuffer.meta = wuffs_base__null_io_buffer_meta();
fIOBuffer.meta = wuffs_base__empty_io_buffer_meta();
SkCodec::Result result =
reset_and_decode_image_config(fDecoder.get(), nullptr, &fIOBuffer, fStream.get());
@ -777,7 +777,7 @@ std::unique_ptr<SkCodec> SkWuffsCodec_MakeFromStream(std::unique_ptr<SkStream> s
uint8_t buffer[SK_WUFFS_CODEC_BUFFER_SIZE];
wuffs_base__io_buffer iobuf =
wuffs_base__make_io_buffer(wuffs_base__make_slice_u8(buffer, SK_WUFFS_CODEC_BUFFER_SIZE),
wuffs_base__null_io_buffer_meta());
wuffs_base__empty_io_buffer_meta());
wuffs_base__image_config imgcfg = wuffs_base__null_image_config();
// Wuffs is primarily a C library, not a C++ one. Furthermore, outside of