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

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

Issue 881953002: patch from issue 885453002 at patchset 20001 (http://crrev.com/885453002#ps20001) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 }; 195 };
196 SkGlyph* fGlyphHash[kHashCount]; 196 SkGlyph* fGlyphHash[kHashCount];
197 SkTDArray<SkGlyph*> fGlyphArray; 197 SkTDArray<SkGlyph*> fGlyphArray;
198 SkChunkAlloc fGlyphAlloc; 198 SkChunkAlloc fGlyphAlloc;
199 199
200 struct CharGlyphRec { 200 struct CharGlyphRec {
201 uint32_t fID; // unichar + subpixel 201 uint32_t fID; // unichar + subpixel
202 SkGlyph* fGlyph; 202 SkGlyph* fGlyph;
203 }; 203 };
204 // no reason to use the same kHashCount as fGlyphHash, but we do for now 204 // no reason to use the same kHashCount as fGlyphHash, but we do for now
205 CharGlyphRec fCharToGlyphHash[kHashCount]; 205 // Dynamically allocated when chars are encountered.
206 SkAutoTDelete<CharGlyphRec> fCharToGlyphHash;
207
208 CharGlyphRec* getCharGlyphRec(uint32_t id);
206 209
207 static inline unsigned ID2HashIndex(uint32_t id) { 210 static inline unsigned ID2HashIndex(uint32_t id) {
208 id ^= id >> 16; 211 id ^= id >> 16;
209 id ^= id >> 8; 212 id ^= id >> 8;
210 return id & kHashMask; 213 return id & kHashMask;
211 } 214 }
212 215
213 // used to track (approx) how much ram is tied-up in this cache 216 // used to track (approx) how much ram is tied-up in this cache
214 size_t fMemoryUsed; 217 size_t fMemoryUsed;
215 218
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 const SkMatrix* matrix) { 293 const SkMatrix* matrix) {
291 fCache = paint.detachCache(deviceProperties, matrix, true); 294 fCache = paint.detachCache(deviceProperties, matrix, true);
292 } 295 }
293 296
294 private: 297 private:
295 SkAutoGlyphCacheNoGamma() : SkAutoGlyphCacheBase() {} 298 SkAutoGlyphCacheNoGamma() : SkAutoGlyphCacheBase() {}
296 }; 299 };
297 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a) 300 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a)
298 301
299 #endif 302 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698