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

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

Issue 939123002: Make fID and MixedID calculations private (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Support android build Created 5 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #include "SkGlyphCache.h" 8 #include "SkGlyphCache.h"
9 #include "SkGlyphCache_Globals.h" 9 #include "SkGlyphCache_Globals.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (glyph->fID < id) { 307 if (glyph->fID < id) {
308 hi += 1; 308 hi += 1;
309 } 309 }
310 } 310 }
311 311
312 // not found, but hi tells us where to inser the new glyph 312 // not found, but hi tells us where to inser the new glyph
313 fMemoryUsed += sizeof(SkGlyph); 313 fMemoryUsed += sizeof(SkGlyph);
314 314
315 glyph = (SkGlyph*)fGlyphAlloc.alloc(sizeof(SkGlyph), 315 glyph = (SkGlyph*)fGlyphAlloc.alloc(sizeof(SkGlyph),
316 SkChunkAlloc::kThrow_AllocFailType); 316 SkChunkAlloc::kThrow_AllocFailType);
317 glyph->init(id); 317 glyph->initCommon(id);
318 *fGlyphArray.insert(hi) = glyph; 318 *fGlyphArray.insert(hi) = glyph;
319 319
320 if (kJustAdvance_MetricsType == mtype) { 320 if (kJustAdvance_MetricsType == mtype) {
321 fScalerContext->getAdvance(glyph); 321 fScalerContext->getAdvance(glyph);
322 } else { 322 } else {
323 SkASSERT(kFull_MetricsType == mtype); 323 SkASSERT(kFull_MetricsType == mtype);
324 fScalerContext->getMetrics(glyph); 324 fScalerContext->getMetrics(glyph);
325 } 325 }
326 326
327 return glyph; 327 return glyph;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 return tls ? tls->getCacheSizeLimit() : 0; 746 return tls ? tls->getCacheSizeLimit() : 0;
747 } 747 }
748 748
749 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { 749 void SkGraphics::SetTLSFontCacheLimit(size_t bytes) {
750 if (0 == bytes) { 750 if (0 == bytes) {
751 SkGlyphCache_Globals::DeleteTLS(); 751 SkGlyphCache_Globals::DeleteTLS();
752 } else { 752 } else {
753 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes); 753 SkGlyphCache_Globals::GetTLS().setCacheSizeLimit(bytes);
754 } 754 }
755 } 755 }
OLDNEW
« src/core/SkGlyph.h ('K') | « src/core/SkGlyph.h ('k') | src/core/SkScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698