| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 { | 350 { |
| 351 #if OS(MACOSX) | 351 #if OS(MACOSX) |
| 352 hb_face_t* face = hb_coretext_face_create(m_platformData->cgFont()); | 352 hb_face_t* face = hb_coretext_face_create(m_platformData->cgFont()); |
| 353 #else | 353 #else |
| 354 hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platform
Data->typeface(), 0); | 354 hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platform
Data->typeface(), 0); |
| 355 #endif | 355 #endif |
| 356 ASSERT(face); | 356 ASSERT(face); |
| 357 return face; | 357 return face; |
| 358 } | 358 } |
| 359 | 359 |
| 360 hb_font_t* HarfBuzzFace::createFont() | 360 hb_font_t* HarfBuzzFace::createFont() const |
| 361 { | 361 { |
| 362 HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCache
Entry, m_face); | 362 HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCache
Entry, m_face); |
| 363 m_platformData->setupPaint(&hbFontData->m_paint); | 363 m_platformData->setupPaint(&hbFontData->m_paint); |
| 364 hbFontData->m_simpleFontData = FontCache::fontCache()->fontDataFromFontPlatf
ormData(m_platformData); | 364 hbFontData->m_simpleFontData = FontCache::fontCache()->fontDataFromFontPlatf
ormData(m_platformData); |
| 365 ASSERT(hbFontData->m_simpleFontData); | 365 ASSERT(hbFontData->m_simpleFontData); |
| 366 hb_font_t* font = hb_font_create(m_face); | 366 hb_font_t* font = hb_font_create(m_face); |
| 367 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB
uzzFontData); | 367 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB
uzzFontData); |
| 368 float size = m_platformData->size(); | 368 float size = m_platformData->size(); |
| 369 int scale = SkiaScalarToHarfBuzzPosition(size); | 369 int scale = SkiaScalarToHarfBuzzPosition(size); |
| 370 hb_font_set_scale(font, scale, scale); | 370 hb_font_set_scale(font, scale, scale); |
| 371 hb_font_make_immutable(font); | 371 hb_font_make_immutable(font); |
| 372 return font; | 372 return font; |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace blink | 375 } // namespace blink |
| OLD | NEW |