Index: src/core/SkRecord.cpp |
diff --git a/src/core/SkRecord.cpp b/src/core/SkRecord.cpp |
index c2008a850a730362e5d3b7a810c05b950ceb3eea..e2d919b777448f7f1a12839b3a514b482f7762a0 100644 |
--- a/src/core/SkRecord.cpp |
+++ b/src/core/SkRecord.cpp |
@@ -1,10 +1,3 @@ |
-/* |
- * Copyright 2015 Google Inc. |
- * |
- * Use of this source code is governed by a BSD-style license that can be |
- * found in the LICENSE file. |
- */ |
- |
#include "SkRecord.h" |
SkRecord::~SkRecord() { |
@@ -16,13 +9,13 @@ |
void SkRecord::grow() { |
SkASSERT(fCount == fReserved); |
- SkASSERT(fReserved > 0); |
- fReserved *= 2; |
+ fReserved = SkTMax<unsigned>(kFirstReserveCount, fReserved*2); |
fRecords.realloc(fReserved); |
+ fTypes.realloc(fReserved); |
} |
size_t SkRecord::bytesUsed() const { |
return fAlloc.approxBytesAllocated() + |
- (fReserved - kInlineRecords) * sizeof(Record) + |
+ fReserved * (sizeof(Record) + sizeof(Type8)) + |
sizeof(SkRecord); |
} |