OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 NGLayoutOpportunityIterator_h | 5 #ifndef NGLayoutOpportunityIterator_h |
6 #define NGLayoutOpportunityIterator_h | 6 #define NGLayoutOpportunityIterator_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" | 9 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" |
10 #include "wtf/Optional.h" | 10 #include "wtf/Optional.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // @param space Constraint space with exclusions for which this iterator needs | 24 // @param space Constraint space with exclusions for which this iterator needs |
25 // to generate layout opportunities. | 25 // to generate layout opportunities. |
26 // @param opt_offset Optional offset parameter that is used as a | 26 // @param opt_offset Optional offset parameter that is used as a |
27 // default start point for layout opportunities. | 27 // default start point for layout opportunities. |
28 // @param opt_leader_point Optional 'leader' parameter that is used to specify | 28 // @param opt_leader_point Optional 'leader' parameter that is used to specify |
29 // the ending point of temporary excluded rectangle | 29 // the ending point of temporary excluded rectangle |
30 // which starts from 'origin'. This rectangle may | 30 // which starts from 'origin'. This rectangle may |
31 // represent a text fragment for example. | 31 // represent a text fragment for example. |
32 NGLayoutOpportunityIterator( | 32 NGLayoutOpportunityIterator( |
33 const NGConstraintSpace* space, | 33 const NGConstraintSpace* space, |
| 34 const NGLogicalSize& available_size, |
34 const WTF::Optional<NGLogicalOffset>& opt_offset = WTF::nullopt, | 35 const WTF::Optional<NGLogicalOffset>& opt_offset = WTF::nullopt, |
35 const WTF::Optional<NGLogicalOffset>& opt_leader_point = WTF::nullopt); | 36 const WTF::Optional<NGLogicalOffset>& opt_leader_point = WTF::nullopt); |
36 | 37 |
37 // Gets the next Layout Opportunity or nullptr if the search is exhausted. | 38 // Gets the next Layout Opportunity or nullptr if the search is exhausted. |
38 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. | 39 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. |
39 const NGLayoutOpportunity Next(); | 40 const NGLayoutOpportunity Next(); |
40 | 41 |
41 // Offset that specifies the starting point to search layout opportunities. | 42 // Offset that specifies the starting point to search layout opportunities. |
42 // It's either {@code opt_offset} or space->BfcOffset(). | 43 // It's either {@code opt_offset} or space->BfcOffset(). |
43 NGLogicalOffset Offset() const { return offset_; } | 44 NGLogicalOffset Offset() const { return offset_; } |
(...skipping 18 matching lines...) Expand all Loading... |
62 | 63 |
63 NGLayoutOpportunities opportunities_; | 64 NGLayoutOpportunities opportunities_; |
64 NGLayoutOpportunities::const_iterator opportunity_iter_; | 65 NGLayoutOpportunities::const_iterator opportunity_iter_; |
65 std::unique_ptr<NGLayoutOpportunityTreeNode> opportunity_tree_root_; | 66 std::unique_ptr<NGLayoutOpportunityTreeNode> opportunity_tree_root_; |
66 NGLogicalOffset offset_; | 67 NGLogicalOffset offset_; |
67 }; | 68 }; |
68 | 69 |
69 } // namespace blink | 70 } // namespace blink |
70 | 71 |
71 #endif // NGLayoutOpportunityIterator_h | 72 #endif // NGLayoutOpportunityIterator_h |
OLD | NEW |