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

Side by Side Diff: include/core/SkColorTable.h

Issue 1311893010: Specialize SkOncePtr<T[]>. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/private/SkOncePtr.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkColorTable_DEFINED 10 #ifndef SkColorTable_DEFINED
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // may return null 54 // may return null
55 static SkColorTable* Create(SkReadBuffer&); 55 static SkColorTable* Create(SkReadBuffer&);
56 56
57 private: 57 private:
58 enum AllocatedWithMalloc { 58 enum AllocatedWithMalloc {
59 kAllocatedWithMalloc 59 kAllocatedWithMalloc
60 }; 60 };
61 // assumes ownership of colors (assumes it was allocated w/ malloc) 61 // assumes ownership of colors (assumes it was allocated w/ malloc)
62 SkColorTable(SkPMColor* colors, int count, AllocatedWithMalloc); 62 SkColorTable(SkPMColor* colors, int count, AllocatedWithMalloc);
63 63
64 struct Free16BitCache { void operator()(uint16_t* cache) const { sk_free(cac he); } }; 64 SkPMColor* fColors;
65 65 SkOncePtr<uint16_t[]> f16BitCache;
66 SkPMColor* fColors; 66 int fCount;
67 SkOncePtr<uint16_t, Free16BitCache> f16BitCache;
68 int fCount;
69 67
70 void init(const SkPMColor* colors, int count); 68 void init(const SkPMColor* colors, int count);
71 69
72 typedef SkRefCnt INHERITED; 70 typedef SkRefCnt INHERITED;
73 }; 71 };
74 72
75 #endif 73 #endif
OLDNEW
« no previous file with comments | « no previous file | include/private/SkOncePtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698