| OLD | NEW |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 explicit FaceCacheEntry(hb_face_t* face) | 76 explicit FaceCacheEntry(hb_face_t* face) |
| 77 : m_face(face) | 77 : m_face(face) |
| 78 { } | 78 { } |
| 79 | 79 |
| 80 hb_face_t* m_face; | 80 hb_face_t* m_face; |
| 81 HashMap<uint32_t, uint16_t> m_glyphCache; | 81 HashMap<uint32_t, uint16_t> m_glyphCache; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 typedef HashMap<uint64_t, RefPtr<FaceCacheEntry>, WTF::IntHash<uint64_t>, WTF::U
nsignedWithZeroKeyHashTraits<uint64_t> > HarfBuzzFaceCache; | 84 typedef HashMap<uint64_t, RefPtr<FaceCacheEntry>, WTF::IntHash<uint64_t>, WTF::U
nsignedWithZeroKeyHashTraits<uint64_t>> HarfBuzzFaceCache; |
| 85 | 85 |
| 86 static HarfBuzzFaceCache* harfBuzzFaceCache() | 86 static HarfBuzzFaceCache* harfBuzzFaceCache() |
| 87 { | 87 { |
| 88 DEFINE_STATIC_LOCAL(HarfBuzzFaceCache, s_harfBuzzFaceCache, ()); | 88 DEFINE_STATIC_LOCAL(HarfBuzzFaceCache, s_harfBuzzFaceCache, ()); |
| 89 return &s_harfBuzzFaceCache; | 89 return &s_harfBuzzFaceCache; |
| 90 } | 90 } |
| 91 | 91 |
| 92 HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID) | 92 HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID) |
| 93 : m_platformData(platformData) | 93 : m_platformData(platformData) |
| 94 , m_uniqueID(uniqueID) | 94 , m_uniqueID(uniqueID) |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 hb_font_t* font = hb_font_create(m_face); | 337 hb_font_t* font = hb_font_create(m_face); |
| 338 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB
uzzFontData); | 338 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB
uzzFontData); |
| 339 float size = m_platformData->size(); | 339 float size = m_platformData->size(); |
| 340 int scale = SkiaScalarToHarfBuzzPosition(size); | 340 int scale = SkiaScalarToHarfBuzzPosition(size); |
| 341 hb_font_set_scale(font, scale, scale); | 341 hb_font_set_scale(font, scale, scale); |
| 342 hb_font_make_immutable(font); | 342 hb_font_make_immutable(font); |
| 343 return font; | 343 return font; |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace blink | 346 } // namespace blink |
| OLD | NEW |