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

Side by Side Diff: Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 1192223002: Optimize Complex Text Shaping and Caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Change CachingWordShaperTest as suggested Created 5 years, 5 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzFace.h ('k') | Source/platform/fonts/shaping/HarfBuzzShaper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698