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 OrientationIterator_h | 5 #ifndef OrientationIterator_h |
6 #define OrientationIterator_h | 6 #define OrientationIterator_h |
7 | 7 |
| 8 #include <memory> |
8 #include "platform/fonts/FontOrientation.h" | 9 #include "platform/fonts/FontOrientation.h" |
9 #include "platform/fonts/ScriptRunIterator.h" | 10 #include "platform/fonts/ScriptRunIterator.h" |
10 #include "platform/fonts/UTF16TextIterator.h" | 11 #include "platform/fonts/UTF16TextIterator.h" |
11 #include "wtf/Allocator.h" | 12 #include "platform/wtf/Allocator.h" |
12 #include "wtf/Noncopyable.h" | 13 #include "platform/wtf/Noncopyable.h" |
13 #include <memory> | |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class PLATFORM_EXPORT OrientationIterator { | 17 class PLATFORM_EXPORT OrientationIterator { |
18 USING_FAST_MALLOC(OrientationIterator); | 18 USING_FAST_MALLOC(OrientationIterator); |
19 WTF_MAKE_NONCOPYABLE(OrientationIterator); | 19 WTF_MAKE_NONCOPYABLE(OrientationIterator); |
20 | 20 |
21 public: | 21 public: |
22 enum RenderOrientation { | 22 enum RenderOrientation { |
23 OrientationKeep, | 23 OrientationKeep, |
24 OrientationRotateSideways, | 24 OrientationRotateSideways, |
25 OrientationInvalid | 25 OrientationInvalid |
26 }; | 26 }; |
27 | 27 |
28 OrientationIterator(const UChar* buffer, | 28 OrientationIterator(const UChar* buffer, |
29 unsigned bufferSize, | 29 unsigned bufferSize, |
30 FontOrientation runOrientation); | 30 FontOrientation runOrientation); |
31 | 31 |
32 bool consume(unsigned* orientationLimit, RenderOrientation*); | 32 bool consume(unsigned* orientationLimit, RenderOrientation*); |
33 | 33 |
34 private: | 34 private: |
35 std::unique_ptr<UTF16TextIterator> m_utf16Iterator; | 35 std::unique_ptr<UTF16TextIterator> m_utf16Iterator; |
36 unsigned m_bufferSize; | 36 unsigned m_bufferSize; |
37 bool m_atEnd; | 37 bool m_atEnd; |
38 }; | 38 }; |
39 | 39 |
40 } // namespace blink | 40 } // namespace blink |
41 | 41 |
42 #endif | 42 #endif |
OLD | NEW |