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

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

Issue 1883483002: Add code to call skia's matchFamilyStyleCharacter API, which uses the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fallbackproxy
Patch Set: Created 4 years, 8 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 FallbackListShaperCache::iterator iter; 367 FallbackListShaperCache::iterator iter;
368 for (iter = gFallbackListShaperCache->begin(); 368 for (iter = gFallbackListShaperCache->begin();
369 iter != gFallbackListShaperCache->end(); 369 iter != gFallbackListShaperCache->end();
370 ++iter) { 370 ++iter) {
371 shapeResultCacheSize += iter->value->byteSize(); 371 shapeResultCacheSize += iter->value->byteSize();
372 } 372 }
373 dump->addScalar("size", "bytes", shapeResultCacheSize); 373 dump->addScalar("size", "bytes", shapeResultCacheSize);
374 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName)); 374 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName));
375 } 375 }
376 376
377 // SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans",
378 // instead of "zh-CN" and "zh-TW".
379 CString toSkFontMgrLocale(const String& locale)
380 {
381 if (!locale.startsWith("zh", TextCaseInsensitive))
382 return locale.ascii();
383
384 switch (localeToScriptCodeForFontSelection(locale)) {
385 case USCRIPT_SIMPLIFIED_HAN:
386 return "zh-Hans";
387 case USCRIPT_TRADITIONAL_HAN:
388 return "zh-Hant";
389 default:
390 return locale.ascii();
391 }
392 }
377 393
378 } // namespace blink 394 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698