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 "SymbolsIterator.h" | 5 #include "SymbolsIterator.h" |
6 | 6 |
7 #include "wtf/PtrUtil.h" | |
8 #include <unicode/uchar.h> | 7 #include <unicode/uchar.h> |
9 #include <unicode/uniset.h> | 8 #include <unicode/uniset.h> |
10 | 9 |
11 namespace blink { | 10 namespace blink { |
12 | 11 |
13 using namespace WTF::Unicode; | 12 using namespace WTF::Unicode; |
14 | 13 |
15 SymbolsIterator::SymbolsIterator(const UChar* buffer, unsigned bufferSize) | 14 SymbolsIterator::SymbolsIterator(const UChar* buffer, unsigned bufferSize) |
16 : m_utf16Iterator(wrapUnique(new UTF16TextIterator(buffer, bufferSize))) | 15 : m_utf16Iterator(adoptPtr(new UTF16TextIterator(buffer, bufferSize))) |
17 , m_bufferSize(bufferSize) | 16 , m_bufferSize(bufferSize) |
18 , m_nextChar(0) | 17 , m_nextChar(0) |
19 , m_atEnd(bufferSize == 0) | 18 , m_atEnd(bufferSize == 0) |
20 , m_currentFontFallbackPriority(FontFallbackPriority::Invalid) | 19 , m_currentFontFallbackPriority(FontFallbackPriority::Invalid) |
21 { | 20 { |
22 } | 21 } |
23 | 22 |
24 FontFallbackPriority SymbolsIterator::fontFallbackPriorityForCharacter(UChar32 c
odepoint) | 23 FontFallbackPriority SymbolsIterator::fontFallbackPriorityForCharacter(UChar32 c
odepoint) |
25 { | 24 { |
26 | 25 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return true; | 145 return true; |
147 } | 146 } |
148 } | 147 } |
149 *symbolsLimit = m_bufferSize; | 148 *symbolsLimit = m_bufferSize; |
150 *fontFallbackPriority = m_currentFontFallbackPriority; | 149 *fontFallbackPriority = m_currentFontFallbackPriority; |
151 m_atEnd = true; | 150 m_atEnd = true; |
152 return true; | 151 return true; |
153 } | 152 } |
154 | 153 |
155 } // namespace blink | 154 } // namespace blink |
OLD | NEW |