Index: src/core/SkRecord.cpp |
diff --git a/src/core/SkRecord.cpp b/src/core/SkRecord.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e2d919b777448f7f1a12839b3a514b482f7762a0 |
--- /dev/null |
+++ b/src/core/SkRecord.cpp |
@@ -0,0 +1,21 @@ |
+#include "SkRecord.h" |
+ |
+SkRecord::~SkRecord() { |
+ Destroyer destroyer; |
+ for (unsigned i = 0; i < this->count(); i++) { |
+ this->mutate<void>(i, destroyer); |
+ } |
+} |
+ |
+void SkRecord::grow() { |
+ SkASSERT(fCount == fReserved); |
+ fReserved = SkTMax<unsigned>(kFirstReserveCount, fReserved*2); |
+ fRecords.realloc(fReserved); |
+ fTypes.realloc(fReserved); |
+} |
+ |
+size_t SkRecord::bytesUsed() const { |
+ return fAlloc.approxBytesAllocated() + |
+ fReserved * (sizeof(Record) + sizeof(Type8)) + |
+ sizeof(SkRecord); |
+} |