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 #ifndef RunSegmenter_h | 5 #ifndef RunSegmenter_h |
6 #define RunSegmenter_h | 6 #define RunSegmenter_h |
7 | 7 |
8 #include "platform/fonts/FontOrientation.h" | 8 #include "platform/fonts/FontOrientation.h" |
9 #include "platform/fonts/FontTraits.h" | 9 #include "platform/fonts/FontTraits.h" |
10 #include "platform/fonts/OrientationIterator.h" | 10 #include "platform/fonts/OrientationIterator.h" |
11 #include "platform/fonts/ScriptRunIterator.h" | 11 #include "platform/fonts/ScriptRunIterator.h" |
12 #include "platform/fonts/SmallCapsIterator.h" | 12 #include "platform/fonts/SmallCapsIterator.h" |
13 #include "platform/fonts/SymbolsIterator.h" | 13 #include "platform/fonts/SymbolsIterator.h" |
14 #include "platform/fonts/UTF16TextIterator.h" | 14 #include "platform/fonts/UTF16TextIterator.h" |
15 #include "wtf/Allocator.h" | 15 #include "wtf/Allocator.h" |
16 #include "wtf/Noncopyable.h" | 16 #include "wtf/Noncopyable.h" |
17 #include <memory> | 17 |
18 #include <unicode/uscript.h> | 18 #include <unicode/uscript.h> |
19 | 19 |
20 namespace blink { | 20 namespace blink { |
21 | 21 |
22 // A tool for segmenting runs prior to shaping, combining ScriptIterator, | 22 // A tool for segmenting runs prior to shaping, combining ScriptIterator, |
23 // OrientationIterator and SmallCapsIterator, depending on orientaton and | 23 // OrientationIterator and SmallCapsIterator, depending on orientaton and |
24 // font-variant of the text run. | 24 // font-variant of the text run. |
25 class PLATFORM_EXPORT RunSegmenter { | 25 class PLATFORM_EXPORT RunSegmenter { |
26 STACK_ALLOCATED(); | 26 STACK_ALLOCATED(); |
27 WTF_MAKE_NONCOPYABLE(RunSegmenter); | 27 WTF_MAKE_NONCOPYABLE(RunSegmenter); |
(...skipping 14 matching lines...) Expand all Loading... |
42 bool consume(RunSegmenterRange*); | 42 bool consume(RunSegmenterRange*); |
43 | 43 |
44 private: | 44 private: |
45 | 45 |
46 void consumeOrientationIteratorPastLastSplit(); | 46 void consumeOrientationIteratorPastLastSplit(); |
47 void consumeScriptIteratorPastLastSplit(); | 47 void consumeScriptIteratorPastLastSplit(); |
48 void consumeSymbolsIteratorPastLastSplit(); | 48 void consumeSymbolsIteratorPastLastSplit(); |
49 | 49 |
50 unsigned m_bufferSize; | 50 unsigned m_bufferSize; |
51 RunSegmenterRange m_candidateRange; | 51 RunSegmenterRange m_candidateRange; |
52 std::unique_ptr<ScriptRunIterator> m_scriptRunIterator; | 52 OwnPtr<ScriptRunIterator> m_scriptRunIterator; |
53 std::unique_ptr<OrientationIterator> m_orientationIterator; | 53 OwnPtr<OrientationIterator> m_orientationIterator; |
54 std::unique_ptr<SymbolsIterator> m_symbolsIterator; | 54 OwnPtr<SymbolsIterator> m_symbolsIterator; |
55 unsigned m_lastSplit; | 55 unsigned m_lastSplit; |
56 unsigned m_scriptRunIteratorPosition; | 56 unsigned m_scriptRunIteratorPosition; |
57 unsigned m_orientationIteratorPosition; | 57 unsigned m_orientationIteratorPosition; |
58 unsigned m_symbolsIteratorPosition; | 58 unsigned m_symbolsIteratorPosition; |
59 bool m_atEnd; | 59 bool m_atEnd; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace blink | 62 } // namespace blink |
63 | 63 |
64 #endif | 64 #endif |
OLD | NEW |