| OLD | NEW |
| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 594 |
| 595 RunSegmenter::RunSegmenterRange segmentRange = { | 595 RunSegmenter::RunSegmenterRange segmentRange = { |
| 596 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::OrientationInvalid, | 596 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::OrientationInvalid, |
| 597 FontFallbackPriority::Invalid}; | 597 FontFallbackPriority::Invalid}; |
| 598 RunSegmenter runSegmenter(m_normalizedBuffer.get(), m_normalizedBufferLength, | 598 RunSegmenter runSegmenter(m_normalizedBuffer.get(), m_normalizedBufferLength, |
| 599 m_font->getFontDescription().orientation()); | 599 m_font->getFontDescription().orientation()); |
| 600 | 600 |
| 601 Vector<UChar32> fallbackCharsHint; | 601 Vector<UChar32> fallbackCharsHint; |
| 602 | 602 |
| 603 // TODO: Check whether this treatAsZerowidthspace from the previous script | 603 // TODO: Check whether this treatAsZerowidthspace from the previous script |
| 604 // segmentation plays a role here, does the new scriptRuniterator handle that
correctly? | 604 // segmentation plays a role here, does the new scriptRuniterator handle that |
| 605 // correctly? |
| 605 while (runSegmenter.consume(&segmentRange)) { | 606 while (runSegmenter.consume(&segmentRange)) { |
| 606 RefPtr<FontFallbackIterator> fallbackIterator = | 607 RefPtr<FontFallbackIterator> fallbackIterator = |
| 607 m_font->createFontFallbackIterator(segmentRange.fontFallbackPriority); | 608 m_font->createFontFallbackIterator(segmentRange.fontFallbackPriority); |
| 608 | 609 |
| 609 appendToHolesQueue(HolesQueueNextFont, 0, 0); | 610 appendToHolesQueue(HolesQueueNextFont, 0, 0); |
| 610 appendToHolesQueue(HolesQueueRange, segmentRange.start, | 611 appendToHolesQueue(HolesQueueRange, segmentRange.start, |
| 611 segmentRange.end - segmentRange.start); | 612 segmentRange.end - segmentRange.start); |
| 612 | 613 |
| 613 RefPtr<FontDataForRangeSet> currentFontDataForRangeSet; | 614 RefPtr<FontDataForRangeSet> currentFontDataForRangeSet; |
| 614 | 615 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 | 656 |
| 656 ASSERT(currentQueueItem.m_numCharacters); | 657 ASSERT(currentQueueItem.m_numCharacters); |
| 657 | 658 |
| 658 const SimpleFontData* smallcapsAdjustedFont = | 659 const SimpleFontData* smallcapsAdjustedFont = |
| 659 needsCapsHandling && capsSupport.needsSyntheticFont(smallCapsBehavior) | 660 needsCapsHandling && capsSupport.needsSyntheticFont(smallCapsBehavior) |
| 660 ? currentFontDataForRangeSet->fontData() | 661 ? currentFontDataForRangeSet->fontData() |
| 661 ->smallCapsFontData(fontDescription) | 662 ->smallCapsFontData(fontDescription) |
| 662 .get() | 663 .get() |
| 663 : currentFontDataForRangeSet->fontData(); | 664 : currentFontDataForRangeSet->fontData(); |
| 664 | 665 |
| 665 // Compatibility with SimpleFontData approach of keeping a flag for overri
ding drawing direction. | 666 // Compatibility with SimpleFontData approach of keeping a flag for |
| 666 // TODO: crbug.com/506224 This should go away in favor of storing that inf
ormation elsewhere, for example in | 667 // overriding drawing direction. |
| 667 // ShapeResult. | 668 // TODO: crbug.com/506224 This should go away in favor of storing that |
| 669 // information elsewhere, for example in ShapeResult. |
| 668 const SimpleFontData* directionAndSmallCapsAdjustedFont = | 670 const SimpleFontData* directionAndSmallCapsAdjustedFont = |
| 669 fontDataAdjustedForOrientation( | 671 fontDataAdjustedForOrientation( |
| 670 smallcapsAdjustedFont, m_font->getFontDescription().orientation(), | 672 smallcapsAdjustedFont, m_font->getFontDescription().orientation(), |
| 671 segmentRange.renderOrientation); | 673 segmentRange.renderOrientation); |
| 672 | 674 |
| 673 CaseMapIntend caseMapIntend = CaseMapIntend::KeepSameCase; | 675 CaseMapIntend caseMapIntend = CaseMapIntend::KeepSameCase; |
| 674 if (needsCapsHandling) { | 676 if (needsCapsHandling) { |
| 675 caseMapIntend = capsSupport.needsCaseChange(smallCapsBehavior); | 677 caseMapIntend = capsSupport.needsCaseChange(smallCapsBehavior); |
| 676 } | 678 } |
| 677 | 679 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 697 segmentRange.script, !fallbackIterator->hasNext())) | 699 segmentRange.script, !fallbackIterator->hasNext())) |
| 698 DLOG(ERROR) << "Shape result extraction failed."; | 700 DLOG(ERROR) << "Shape result extraction failed."; |
| 699 | 701 |
| 700 hb_buffer_reset(harfBuzzBuffer.get()); | 702 hb_buffer_reset(harfBuzzBuffer.get()); |
| 701 } | 703 } |
| 702 } | 704 } |
| 703 return result.release(); | 705 return result.release(); |
| 704 } | 706 } |
| 705 | 707 |
| 706 } // namespace blink | 708 } // namespace blink |
| OLD | NEW |