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

Side by Side Diff: Source/core/platform/graphics/chromium/FontCacheAndroid.cpp

Issue 23503080: Pass DOM locale to Skia in FontCache::getFontDataForCharacter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@fontcleanup
Patch Set: Pure Android only Created 7 years, 3 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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 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 24 matching lines...) Expand all
35 #include "core/platform/graphics/FontDescription.h" 35 #include "core/platform/graphics/FontDescription.h"
36 #include "core/platform/graphics/SimpleFontData.h" 36 #include "core/platform/graphics/SimpleFontData.h"
37 37
38 #include "SkTypeface_android.h" 38 #include "SkTypeface_android.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c) 42 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c)
43 { 43 {
44 SkString skiaFamilyName; 44 SkString skiaFamilyName;
45 if (!SkGetFallbackFamilyNameForChar(c, &skiaFamilyName) || skiaFamilyName.is Empty()) 45 if (!SkGetFallbackFamilyNameForChar(c, font.fontDescription().locale().strin g().ascii().data(), &skiaFamilyName)
falken 2013/09/25 08:11:51 What happens if a page has -webkit-locale: '<crazy
djsollen 2013/09/25 13:20:19 Skia uses that value to search over a list of know
46 || skiaFamilyName.isEmpty())
46 return 0; 47 return 0;
47 return getFontResourceData(getFontResourcePlatformData(font.fontDescription( ), AtomicString(skiaFamilyName.c_str()), DoNotRetain), DoNotRetain); 48 return getFontResourceData(getFontResourcePlatformData(font.fontDescription( ), AtomicString(skiaFamilyName.c_str()), DoNotRetain), DoNotRetain);
48 } 49 }
49 50
50 } // namespace WebCore 51 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698