| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/fonts/shaping/RunSegmenter.h" | 5 #include "platform/fonts/shaping/RunSegmenter.h" |
| 6 | 6 |
| 7 #include "platform/fonts/ScriptRunIterator.h" | 7 #include "platform/fonts/ScriptRunIterator.h" |
| 8 #include "platform/fonts/SmallCapsIterator.h" | 8 #include "platform/fonts/SmallCapsIterator.h" |
| 9 #include "platform/fonts/SymbolsIterator.h" | 9 #include "platform/fonts/SymbolsIterator.h" |
| 10 #include "platform/fonts/UTF16TextIterator.h" | 10 #include "platform/fonts/UTF16TextIterator.h" |
| 11 #include "platform/text/Character.h" | 11 #include "platform/text/Character.h" |
| 12 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 13 #include "wtf/PtrUtil.h" | |
| 14 | 13 |
| 15 namespace blink { | 14 namespace blink { |
| 16 | 15 |
| 17 RunSegmenter::RunSegmenter(const UChar* buffer, unsigned bufferSize, FontOrienta
tion runOrientation) | 16 RunSegmenter::RunSegmenter(const UChar* buffer, unsigned bufferSize, FontOrienta
tion runOrientation) |
| 18 : m_bufferSize(bufferSize) | 17 : m_bufferSize(bufferSize) |
| 19 , m_candidateRange({ 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::Orient
ationKeep, FontFallbackPriority::Text }) | 18 , m_candidateRange({ 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::Orient
ationKeep, FontFallbackPriority::Text }) |
| 20 , m_scriptRunIterator(wrapUnique(new ScriptRunIterator(buffer, bufferSize))) | 19 , m_scriptRunIterator(adoptPtr(new ScriptRunIterator(buffer, bufferSize))) |
| 21 , m_orientationIterator(runOrientation == FontOrientation::VerticalMixed ? w
rapUnique(new OrientationIterator(buffer, bufferSize, runOrientation)) : nullptr
) | 20 , m_orientationIterator(runOrientation == FontOrientation::VerticalMixed ? a
doptPtr(new OrientationIterator(buffer, bufferSize, runOrientation)) : nullptr) |
| 22 , m_symbolsIterator(wrapUnique(new SymbolsIterator(buffer, bufferSize))) | 21 , m_symbolsIterator(adoptPtr(new SymbolsIterator(buffer, bufferSize))) |
| 23 , m_lastSplit(0) | 22 , m_lastSplit(0) |
| 24 , m_scriptRunIteratorPosition(0) | 23 , m_scriptRunIteratorPosition(0) |
| 25 , m_orientationIteratorPosition(runOrientation == FontOrientation::VerticalM
ixed ? 0 : m_bufferSize) | 24 , m_orientationIteratorPosition(runOrientation == FontOrientation::VerticalM
ixed ? 0 : m_bufferSize) |
| 26 , m_symbolsIteratorPosition(0) | 25 , m_symbolsIteratorPosition(0) |
| 27 , m_atEnd(false) | 26 , m_atEnd(false) |
| 28 { | 27 { |
| 29 } | 28 } |
| 30 | 29 |
| 31 void RunSegmenter::consumeScriptIteratorPastLastSplit() | 30 void RunSegmenter::consumeScriptIteratorPastLastSplit() |
| 32 { | 31 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 m_candidateRange.start = m_candidateRange.end; | 86 m_candidateRange.start = m_candidateRange.end; |
| 88 m_candidateRange.end = m_lastSplit; | 87 m_candidateRange.end = m_lastSplit; |
| 89 *nextRange = m_candidateRange; | 88 *nextRange = m_candidateRange; |
| 90 | 89 |
| 91 m_atEnd = m_lastSplit == m_bufferSize; | 90 m_atEnd = m_lastSplit == m_bufferSize; |
| 92 return true; | 91 return true; |
| 93 } | 92 } |
| 94 | 93 |
| 95 | 94 |
| 96 } // namespace blink | 95 } // namespace blink |
| OLD | NEW |