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

Side by Side Diff: src/core/SkRecord.h

Issue 741793002: Add SkNVRefCnt, prune down SkPicture's size (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak name 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 unified diff | Download patch
« no previous file with comments | « include/core/SkRefCnt.h ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkRecord_DEFINED 8 #ifndef SkRecord_DEFINED
9 #define SkRecord_DEFINED 9 #define SkRecord_DEFINED
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 private: 224 private:
225 void* fPtr; 225 void* fPtr;
226 }; 226 };
227 227
228 // fAlloc needs to be a data structure which can append variable length data in contiguous 228 // fAlloc needs to be a data structure which can append variable length data in contiguous
229 // chunks, returning a stable handle to that data for later retrieval. 229 // chunks, returning a stable handle to that data for later retrieval.
230 // 230 //
231 // fRecords and fTypes need to be data structures that can append fixed leng th data, and need to 231 // fRecords and fTypes need to be data structures that can append fixed leng th data, and need to
232 // support efficient random access and forward iteration. (They don't need to be contiguous.) 232 // support efficient random access and forward iteration. (They don't need to be contiguous.)
233 233
234 SkVarAlloc fAlloc;
235 SkAutoTMalloc<Record> fRecords;
236 SkAutoTMalloc<Type8> fTypes;
237 // fCount and fReserved measure both fRecords and fTypes, which always grow in lock step. 234 // fCount and fReserved measure both fRecords and fTypes, which always grow in lock step.
238 unsigned fCount; 235 unsigned fCount;
239 unsigned fReserved; 236 unsigned fReserved;
237 SkAutoTMalloc<Record> fRecords;
238 SkAutoTMalloc<Type8> fTypes;
239 SkVarAlloc fAlloc;
240 // Strangely the order of these fields matters. If the unsigneds don't go f irst we're 56 bytes.
241 // tomhudson and mtklein have no idea why.
240 }; 242 };
243 SK_COMPILE_ASSERT(sizeof(SkRecord) <= 48, SkRecordSize);
241 244
242 #endif//SkRecord_DEFINED 245 #endif//SkRecord_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkRefCnt.h ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698