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

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

Issue 17449012: combine glyph and image bulk alloc, and adjust initial alloc size, to reduce total waste from 50% t… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkChunkAlloc.cpp ('k') | src/core/SkGlyphCache.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 SkGlyphCache_DEFINED 10 #ifndef SkGlyphCache_DEFINED
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 SkPaint::FontMetrics fFontMetrics; 223 SkPaint::FontMetrics fFontMetrics;
224 224
225 enum { 225 enum {
226 kHashBits = 8, 226 kHashBits = 8,
227 kHashCount = 1 << kHashBits, 227 kHashCount = 1 << kHashBits,
228 kHashMask = kHashCount - 1 228 kHashMask = kHashCount - 1
229 }; 229 };
230 SkGlyph* fGlyphHash[kHashCount]; 230 SkGlyph* fGlyphHash[kHashCount];
231 SkTDArray<SkGlyph*> fGlyphArray; 231 SkTDArray<SkGlyph*> fGlyphArray;
232 SkChunkAlloc fGlyphAlloc; 232 SkChunkAlloc fGlyphAlloc;
233 SkChunkAlloc fImageAlloc;
234 233
235 int fMetricsCount, fAdvanceCount; 234 int fMetricsCount, fAdvanceCount;
236 235
237 struct CharGlyphRec { 236 struct CharGlyphRec {
238 uint32_t fID; // unichar + subpixel 237 uint32_t fID; // unichar + subpixel
239 SkGlyph* fGlyph; 238 SkGlyph* fGlyph;
240 }; 239 };
241 // no reason to use the same kHashCount as fGlyphHash, but we do for now 240 // no reason to use the same kHashCount as fGlyphHash, but we do for now
242 CharGlyphRec fCharToGlyphHash[kHashCount]; 241 CharGlyphRec fCharToGlyphHash[kHashCount];
243 242
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 291 }
293 } 292 }
294 293
295 private: 294 private:
296 SkGlyphCache* fCache; 295 SkGlyphCache* fCache;
297 296
298 static bool DetachProc(const SkGlyphCache*, void*); 297 static bool DetachProc(const SkGlyphCache*, void*);
299 }; 298 };
300 299
301 #endif 300 #endif
OLDNEW
« no previous file with comments | « src/core/SkChunkAlloc.cpp ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698