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