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

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

Issue 721313002: Deparameterize SkVarAlloc. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixes: update unit test, remove unused header, start at 16 bytes 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 | « no previous file | src/core/SkVarAlloc.h » ('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 12 matching lines...) Expand all
23 // SkRecord often looks like it's compatible with any type T, but really it's co mpatible with any 23 // SkRecord often looks like it's compatible with any type T, but really it's co mpatible with any
24 // type T which has a static const SkRecords::Type kType. That is to say, SkRec ord is compatible 24 // type T which has a static const SkRecords::Type kType. That is to say, SkRec ord is compatible
25 // only with SkRecords::* structs defined in SkRecords.h. Your compiler will he lpfully yell if you 25 // only with SkRecords::* structs defined in SkRecords.h. Your compiler will he lpfully yell if you
26 // get this wrong. 26 // get this wrong.
27 27
28 class SkRecord : SkNoncopyable { 28 class SkRecord : SkNoncopyable {
29 enum { 29 enum {
30 kFirstReserveCount = 64 / sizeof(void*), 30 kFirstReserveCount = 64 / sizeof(void*),
31 }; 31 };
32 public: 32 public:
33 SkRecord() : fAlloc(1024, 2.0f), fCount(0), fReserved(0) {} 33 SkRecord() : fCount(0), fReserved(0) {}
34 34
35 ~SkRecord() { 35 ~SkRecord() {
36 Destroyer destroyer; 36 Destroyer destroyer;
37 for (unsigned i = 0; i < this->count(); i++) { 37 for (unsigned i = 0; i < this->count(); i++) {
38 this->mutate<void>(i, destroyer); 38 this->mutate<void>(i, destroyer);
39 } 39 }
40 } 40 }
41 41
42 // Returns the number of canvas commands in this SkRecord. 42 // Returns the number of canvas commands in this SkRecord.
43 unsigned count() const { return fCount; } 43 unsigned count() const { return fCount; }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 SkVarAlloc fAlloc; 228 SkVarAlloc fAlloc;
229 SkAutoTMalloc<Record> fRecords; 229 SkAutoTMalloc<Record> fRecords;
230 SkAutoTMalloc<Type8> fTypes; 230 SkAutoTMalloc<Type8> fTypes;
231 // fCount and fReserved measure both fRecords and fTypes, which always grow in lock step. 231 // fCount and fReserved measure both fRecords and fTypes, which always grow in lock step.
232 unsigned fCount; 232 unsigned fCount;
233 unsigned fReserved; 233 unsigned fReserved;
234 }; 234 };
235 235
236 #endif//SkRecord_DEFINED 236 #endif//SkRecord_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkVarAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698