OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NGInlineItemResult_h |
| 6 #define NGInlineItemResult_h |
| 7 |
| 8 #include "core/layout/ng/ng_layout_result.h" |
| 9 #include "platform/LayoutUnit.h" |
| 10 #include "platform/fonts/shaping/ShapeResult.h" |
| 11 #include "platform/wtf/Allocator.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // The result of measuring NGInlineItem. |
| 16 // |
| 17 // This is a transient context object only while building line boxes. |
| 18 // Produced while determining the line break points, but these data are needed |
| 19 // to create line boxes. |
| 20 // |
| 21 // NGLineBreaker produces, and NGInlineLayoutAlgorithm consumes. |
| 22 struct CORE_EXPORT NGInlineItemResult { |
| 23 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 24 |
| 25 public: |
| 26 // The index of NGInlineItem and its text range. |
| 27 unsigned item_index; |
| 28 unsigned start_offset; |
| 29 unsigned end_offset; |
| 30 |
| 31 // Inline size of this item. |
| 32 LayoutUnit inline_size; |
| 33 |
| 34 // ShapeResult for text items. Maybe different from NGInlineItem if re-shape |
| 35 // is needed in the line breaker. |
| 36 RefPtr<ShapeResult> shape_result; |
| 37 |
| 38 // NGLayoutResult for atomic inline items. |
| 39 RefPtr<NGLayoutResult> layout_result; |
| 40 |
| 41 NGInlineItemResult(); |
| 42 NGInlineItemResult(unsigned index, unsigned start, unsigned end); |
| 43 }; |
| 44 |
| 45 // Represents a set of NGInlineItemResult that form a line box. |
| 46 using NGInlineItemResults = Vector<NGInlineItemResult, 32>; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // NGInlineItemResult_h |
OLD | NEW |