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

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

Issue 1758383002: Revert of Use FontFallbackPriority Fonts in FontFallbackIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 };
541 RunSegmenter runSegmenter( 540 RunSegmenter runSegmenter(
542 m_normalizedBuffer.get(), 541 m_normalizedBuffer.get(),
543 m_normalizedBufferLength, 542 m_normalizedBufferLength,
544 m_font->fontDescription().orientation(), 543 m_font->fontDescription().orientation(),
545 fontDescription.variant()); 544 fontDescription.variant());
546 545
547 Vector<UChar32> fallbackCharsHint; 546 Vector<UChar32> fallbackCharsHint;
548 547
549 // TODO: Check whether this treatAsZerowidthspace from the previous script 548 // TODO: Check whether this treatAsZerowidthspace from the previous script
550 // segmentation plays a role here, does the new scriptRuniterator handle tha t correctly? 549 // segmentation plays a role here, does the new scriptRuniterator handle tha t correctly?
551 while (runSegmenter.consume(&segmentRange)) { 550 while (runSegmenter.consume(&segmentRange)) {
552 RefPtr<FontFallbackIterator> fallbackIterator = 551 RefPtr<FontFallbackIterator> fallbackIterator = m_font->createFontFallba ckIterator();
553 m_font->createFontFallbackIterator(
554 segmentRange.fontFallbackPriority);
555 552
556 appendToHolesQueue(HolesQueueNextFont, 0, 0); 553 appendToHolesQueue(HolesQueueNextFont, 0, 0);
557 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end - segmentRange.start); 554 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end - segmentRange.start);
558 555
559 const SimpleFontData* currentFont = nullptr; 556 const SimpleFontData* currentFont = nullptr;
560 unsigned currentFontRangeFrom = 0; 557 unsigned currentFontRangeFrom = 0;
561 unsigned currentFontRangeTo = 0; 558 unsigned currentFontRangeTo = 0;
562 559
563 bool fontCycleQueued = false; 560 bool fontCycleQueued = false;
564 while (m_holesQueue.size()) { 561 while (m_holesQueue.size()) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 797 }
801 798
802 // 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
803 spacing += nextExpansionPerOpportunity(); 800 spacing += nextExpansionPerOpportunity();
804 m_isAfterExpansion = true; 801 m_isAfterExpansion = true;
805 return spacing; 802 return spacing;
806 } 803 }
807 804
808 805
809 } // namespace blink 806 } // 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