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

Unified Diff: src/core/SkRecord.cpp

Issue 1068383003: Revert of Rearrange SkRecord with small N in mind (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months 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') | src/core/SkVarAlloc.h » ('j') | 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
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);
}
« no previous file with comments | « src/core/SkRecord.h ('k') | src/core/SkVarAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698