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 "OrientationIterator.h" | 5 #include "OrientationIterator.h" |
6 | 6 |
| 7 #include "wtf/PtrUtil.h" |
| 8 |
7 namespace blink { | 9 namespace blink { |
8 | 10 |
9 OrientationIterator::OrientationIterator(const UChar* buffer, unsigned bufferSiz
e, FontOrientation runOrientation) | 11 OrientationIterator::OrientationIterator(const UChar* buffer, unsigned bufferSiz
e, FontOrientation runOrientation) |
10 : m_utf16Iterator(adoptPtr(new UTF16TextIterator(buffer, bufferSize))) | 12 : m_utf16Iterator(wrapUnique(new UTF16TextIterator(buffer, bufferSize))) |
11 , m_bufferSize(bufferSize) | 13 , m_bufferSize(bufferSize) |
12 , m_atEnd(bufferSize == 0) | 14 , m_atEnd(bufferSize == 0) |
13 { | 15 { |
14 // There's not much point in segmenting by isUprightInVertical if the text | 16 // There's not much point in segmenting by isUprightInVertical if the text |
15 // orientation is not "mixed". | 17 // orientation is not "mixed". |
16 ASSERT(runOrientation == FontOrientation::VerticalMixed); | 18 ASSERT(runOrientation == FontOrientation::VerticalMixed); |
17 } | 19 } |
18 | 20 |
19 bool OrientationIterator::consume(unsigned *orientationLimit, RenderOrientation*
renderOrientation) | 21 bool OrientationIterator::consume(unsigned *orientationLimit, RenderOrientation*
renderOrientation) |
20 { | 22 { |
(...skipping 19 matching lines...) Expand all Loading... |
40 } | 42 } |
41 m_utf16Iterator->advance(); | 43 m_utf16Iterator->advance(); |
42 } | 44 } |
43 *orientationLimit = m_bufferSize; | 45 *orientationLimit = m_bufferSize; |
44 *renderOrientation = currentRenderOrientation; | 46 *renderOrientation = currentRenderOrientation; |
45 m_atEnd = true; | 47 m_atEnd = true; |
46 return true; | 48 return true; |
47 } | 49 } |
48 | 50 |
49 } // namespace blink | 51 } // namespace blink |
OLD | NEW |