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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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 (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 static HarfBuzzFontCache* harfBuzzFontCache() { 139 static HarfBuzzFontCache* harfBuzzFontCache() {
140 DEFINE_STATIC_LOCAL(HarfBuzzFontCache, s_harfBuzzFontCache, ()); 140 DEFINE_STATIC_LOCAL(HarfBuzzFontCache, s_harfBuzzFontCache, ());
141 return &s_harfBuzzFontCache; 141 return &s_harfBuzzFontCache;
142 } 142 }
143 143
144 static PassRefPtr<HbFontCacheEntry> createHbFontCacheEntry(hb_face_t*); 144 static PassRefPtr<HbFontCacheEntry> createHbFontCacheEntry(hb_face_t*);
145 145
146 HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID) 146 HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID)
147 : m_platformData(platformData), m_uniqueID(uniqueID) { 147 : m_platformData(platformData), m_uniqueID(uniqueID) {
148 HarfBuzzFontCache::AddResult result = 148 HarfBuzzFontCache::AddResult result =
149 harfBuzzFontCache()->add(m_uniqueID, nullptr); 149 harfBuzzFontCache()->insert(m_uniqueID, nullptr);
150 if (result.isNewEntry) { 150 if (result.isNewEntry) {
151 HbFaceUniquePtr face(createFace()); 151 HbFaceUniquePtr face(createFace());
152 result.storedValue->value = createHbFontCacheEntry(face.get()); 152 result.storedValue->value = createHbFontCacheEntry(face.get());
153 } 153 }
154 result.storedValue->value->ref(); 154 result.storedValue->value->ref();
155 m_unscaledFont = result.storedValue->value->hbFont(); 155 m_unscaledFont = result.storedValue->value->hbFont();
156 m_harfBuzzFontData = result.storedValue->value->hbFontData(); 156 m_harfBuzzFontData = result.storedValue->value->hbFontData();
157 } 157 }
158 158
159 HarfBuzzFace::~HarfBuzzFace() { 159 HarfBuzzFace::~HarfBuzzFace() {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 389
390 // TODO crbug.com/674879 - Connect variation axis parameters to future 390 // TODO crbug.com/674879 - Connect variation axis parameters to future
391 // HarfBuzz API here. 391 // HarfBuzz API here.
392 ASSERT(m_harfBuzzFontData->m_simpleFontData); 392 ASSERT(m_harfBuzzFontData->m_simpleFontData);
393 int scale = SkiaScalarToHarfBuzzPosition(m_platformData->size()); 393 int scale = SkiaScalarToHarfBuzzPosition(m_platformData->size());
394 hb_font_set_scale(m_unscaledFont, scale, scale); 394 hb_font_set_scale(m_unscaledFont, scale, scale);
395 return m_unscaledFont; 395 return m_unscaledFont;
396 } 396 }
397 397
398 } // namespace blink 398 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.cpp ('k') | third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698