OLD | NEW |
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 FallbackListShaperCache::iterator iter; | 404 FallbackListShaperCache::iterator iter; |
405 for (iter = gFallbackListShaperCache->begin(); | 405 for (iter = gFallbackListShaperCache->begin(); |
406 iter != gFallbackListShaperCache->end(); | 406 iter != gFallbackListShaperCache->end(); |
407 ++iter) { | 407 ++iter) { |
408 shapeResultCacheSize += iter->value->byteSize(); | 408 shapeResultCacheSize += iter->value->byteSize(); |
409 } | 409 } |
410 dump->AddScalar("size", "bytes", shapeResultCacheSize); | 410 dump->AddScalar("size", "bytes", shapeResultCacheSize); |
411 memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::kAllocatedObject
PoolName); | 411 memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::kAllocatedObject
PoolName); |
412 } | 412 } |
413 | 413 |
414 // SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans", | |
415 // instead of "zh-CN" and "zh-TW". | |
416 CString toSkFontMgrLocale(const String& locale) | |
417 { | |
418 if (!locale.startsWith("zh", TextCaseInsensitive)) | |
419 return locale.ascii(); | |
420 | |
421 switch (localeToScriptCodeForFontSelection(locale)) { | |
422 case USCRIPT_SIMPLIFIED_HAN: | |
423 return "zh-Hans"; | |
424 case USCRIPT_TRADITIONAL_HAN: | |
425 return "zh-Hant"; | |
426 default: | |
427 return locale.ascii(); | |
428 } | |
429 } | |
430 | |
431 } // namespace blink | 414 } // namespace blink |
OLD | NEW |