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

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

Issue 1733193002: Move glyph lookup to hb-ot-font and remove glyph cache in HarfBuzzFace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated memory management, no more ref'ing, OwnPtr in HarfBuzzFace Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 hb_buffer_set_language(harfBuzzBuffer, language); 335 hb_buffer_set_language(harfBuzzBuffer, language);
336 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript)); 336 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript));
337 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(), 337 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(),
338 m_font->fontDescription().orientation(), currentFont)); 338 m_font->fontDescription().orientation(), currentFont));
339 339
340 addToHarfBuzzBufferInternal(harfBuzzBuffer, 340 addToHarfBuzzBufferInternal(harfBuzzBuffer,
341 m_font->fontDescription(), m_normalizedBuffer.get(), m_normalizedBufferL ength, 341 m_font->fontDescription(), m_normalizedBuffer.get(), m_normalizedBufferL ength,
342 startIndex, numCharacters); 342 startIndex, numCharacters);
343 343
344 HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(currentFontRangeF rom, currentFontRangeTo), hb_font_destroy); 344 hb_font_t* hbFont = face->getScaledFont(currentFontRangeFrom, currentFontRan geTo);
345 hb_shape(harfBuzzFont.get(), harfBuzzBuffer, m_features.isEmpty() ? 0 : m_fe atures.data(), m_features.size()); 345 hb_shape(hbFont, harfBuzzBuffer, m_features.isEmpty() ? 0 : m_features.data( ), m_features.size());
346 346
347 return true; 347 return true;
348 } 348 }
349 349
350 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer, 350 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer,
351 ShapeResult* shapeResult, 351 ShapeResult* shapeResult,
352 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem, 352 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem,
353 const SimpleFontData* currentFont, 353 const SimpleFontData* currentFont,
354 UScriptCode currentRunScript, 354 UScriptCode currentRunScript,
355 bool isLastResort) 355 bool isLastResort)
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 797 }
798 798
799 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above 799 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above
800 spacing += nextExpansionPerOpportunity(); 800 spacing += nextExpansionPerOpportunity();
801 m_isAfterExpansion = true; 801 m_isAfterExpansion = true;
802 return spacing; 802 return spacing;
803 } 803 }
804 804
805 805
806 } // namespace blink 806 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698