Index: src/core/SkRWBuffer.cpp |
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp |
index 07a537a640a27173bea2093614bef8a468db0d01..b8dffa7bf329864ab4dcae2f2fc3511b38d29b14 100644 |
--- a/src/core/SkRWBuffer.cpp |
+++ b/src/core/SkRWBuffer.cpp |
@@ -194,7 +194,7 @@ SkRWBuffer::~SkRWBuffer() { |
// next, since our reader will be using fCapacity (min'd against its total available) to know how |
// many bytes to read from a given block. |
// |
-void SkRWBuffer::append(const void* src, size_t length) { |
+void SkRWBuffer::append(const void* src, size_t length, size_t reserve) { |
this->validate(); |
if (0 == length) { |
return; |
@@ -203,7 +203,7 @@ void SkRWBuffer::append(const void* src, size_t length) { |
fTotalUsed += length; |
if (nullptr == fHead) { |
- fHead = SkBufferHead::Alloc(length); |
+ fHead = SkBufferHead::Alloc(length + reserve); |
fTail = &fHead->fBlock; |
} |
@@ -213,7 +213,7 @@ void SkRWBuffer::append(const void* src, size_t length) { |
length -= written; |
if (length) { |
- SkBufferBlock* block = SkBufferBlock::Alloc(length); |
+ SkBufferBlock* block = SkBufferBlock::Alloc(length + reserve); |
fTail->fNext = block; |
fTail = block; |
written = fTail->append(src, length); |