Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: src/core/SkRecord.cpp

Issue 756783002: SkRecord: outline methods that are not called O(N) times. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecord.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « src/core/SkRecord.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698