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

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

Issue 1672553004: Use FontFallbackPriority Fonts in FontFallbackIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win rebaselines for emoji related test 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/FontFallbackIterator.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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 const FontDescription& fontDescription = m_font->fontDescription(); 529 const FontDescription& fontDescription = m_font->fontDescription();
530 const String& localeString = fontDescription.locale(); 530 const String& localeString = fontDescription.locale();
531 CString locale = localeString.latin1(); 531 CString locale = localeString.latin1();
532 const hb_language_t language = hb_language_from_string(locale.data(), locale .length()); 532 const hb_language_t language = hb_language_from_string(locale.data(), locale .length());
533 533
534 RunSegmenter::RunSegmenterRange segmentRange = { 534 RunSegmenter::RunSegmenterRange segmentRange = {
535 0, 535 0,
536 0, 536 0,
537 USCRIPT_INVALID_CODE, 537 USCRIPT_INVALID_CODE,
538 OrientationIterator::OrientationInvalid, 538 OrientationIterator::OrientationInvalid,
539 SmallCapsIterator::SmallCapsSameCase }; 539 SmallCapsIterator::SmallCapsSameCase,
540 FontFallbackPriority::Invalid };
540 RunSegmenter runSegmenter( 541 RunSegmenter runSegmenter(
541 m_normalizedBuffer.get(), 542 m_normalizedBuffer.get(),
542 m_normalizedBufferLength, 543 m_normalizedBufferLength,
543 m_font->fontDescription().orientation(), 544 m_font->fontDescription().orientation(),
544 fontDescription.variant()); 545 fontDescription.variant());
545 546
546 Vector<UChar32> fallbackCharsHint; 547 Vector<UChar32> fallbackCharsHint;
547 548
548 // TODO: Check whether this treatAsZerowidthspace from the previous script 549 // TODO: Check whether this treatAsZerowidthspace from the previous script
549 // segmentation plays a role here, does the new scriptRuniterator handle tha t correctly? 550 // segmentation plays a role here, does the new scriptRuniterator handle tha t correctly?
550 while (runSegmenter.consume(&segmentRange)) { 551 while (runSegmenter.consume(&segmentRange)) {
551 RefPtr<FontFallbackIterator> fallbackIterator = m_font->createFontFallba ckIterator(); 552 RefPtr<FontFallbackIterator> fallbackIterator =
553 m_font->createFontFallbackIterator(
554 segmentRange.fontFallbackPriority);
552 555
553 appendToHolesQueue(HolesQueueNextFont, 0, 0); 556 appendToHolesQueue(HolesQueueNextFont, 0, 0);
554 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end - segmentRange.start); 557 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end - segmentRange.start);
555 558
556 const SimpleFontData* currentFont = nullptr; 559 const SimpleFontData* currentFont = nullptr;
557 unsigned currentFontRangeFrom = 0; 560 unsigned currentFontRangeFrom = 0;
558 unsigned currentFontRangeTo = 0; 561 unsigned currentFontRangeTo = 0;
559 562
560 bool fontCycleQueued = false; 563 bool fontCycleQueued = false;
561 while (m_holesQueue.size()) { 564 while (m_holesQueue.size()) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 800 }
798 801
799 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above 802 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above
800 spacing += nextExpansionPerOpportunity(); 803 spacing += nextExpansionPerOpportunity();
801 m_isAfterExpansion = true; 804 m_isAfterExpansion = true;
802 return spacing; 805 return spacing;
803 } 806 }
804 807
805 808
806 } // namespace blink 809 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698