Ensure that streams written using SkFlattenableBuffer's can be read with readByteArray(...)
Review URL: https://codereview.appspot.com/7138063 git-svn-id: http://skia.googlecode.com/svn/trunk@7335 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
98ded84b80
commit
e782f5ee47
@ -132,7 +132,12 @@ void SkOrderedWriteBuffer::writePath(const SkPath& path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t SkOrderedWriteBuffer::writeStream(SkStream* stream, size_t length) {
|
size_t SkOrderedWriteBuffer::writeStream(SkStream* stream, size_t length) {
|
||||||
return fWriter.readFromStream(stream, length);
|
fWriter.write32(length);
|
||||||
|
size_t bytesWritten = fWriter.readFromStream(stream, length);
|
||||||
|
if (bytesWritten < length) {
|
||||||
|
fWriter.reservePad(length - bytesWritten);
|
||||||
|
}
|
||||||
|
return bytesWritten;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkOrderedWriteBuffer::writeToStream(SkWStream* stream) {
|
bool SkOrderedWriteBuffer::writeToStream(SkWStream* stream) {
|
||||||
|
Loading…
Reference in New Issue
Block a user