OLD | NEW |
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 Loading... |
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 |
OLD | NEW |