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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 1931393002: Introduce typeface cache in blink::FontCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: others Created 4 years, 7 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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 if (!face) { 306 if (!face) {
307 DLOG(ERROR) << "Could not create HarfBuzzFace from FontPlatformData."; 307 DLOG(ERROR) << "Could not create HarfBuzzFace from FontPlatformData.";
308 return false; 308 return false;
309 } 309 }
310 310
311 hb_buffer_set_language(harfBuzzBuffer, language); 311 hb_buffer_set_language(harfBuzzBuffer, language);
312 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript)); 312 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript));
313 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(), 313 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(),
314 m_font->getFontDescription().orientation(), currentFont)); 314 m_font->getFontDescription().orientation(), currentFont));
315 315
316 HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(currentFontRangeS et), hb_font_destroy); 316 HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(currentFont->size (), currentFont->style(), currentFontRangeSet), hb_font_destroy);
317 hb_shape(harfBuzzFont.get(), harfBuzzBuffer, m_features.isEmpty() ? 0 : m_fe atures.data(), m_features.size()); 317 hb_shape(harfBuzzFont.get(), harfBuzzBuffer, m_features.isEmpty() ? 0 : m_fe atures.data(), m_features.size());
318 318
319 return true; 319 return true;
320 } 320 }
321 321
322 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer, 322 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer,
323 ShapeResult* shapeResult, 323 ShapeResult* shapeResult,
324 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem, 324 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem,
325 const SimpleFontData* currentFont, 325 const SimpleFontData* currentFont,
326 UScriptCode currentRunScript, 326 UScriptCode currentRunScript,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 result->m_width = run->m_width; 680 result->m_width = run->m_width;
681 result->m_numGlyphs = count; 681 result->m_numGlyphs = count;
682 ASSERT(result->m_numGlyphs == count); // no overflow 682 ASSERT(result->m_numGlyphs == count); // no overflow
683 result->m_hasVerticalOffsets = fontData->platformData().isVerticalAnyUpright (); 683 result->m_hasVerticalOffsets = fontData->platformData().isVerticalAnyUpright ();
684 result->m_runs.append(run.release()); 684 result->m_runs.append(run.release());
685 return result.release(); 685 return result.release();
686 } 686 }
687 687
688 688
689 } // namespace blink 689 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698