Chromium Code Reviews| 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_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
| 10 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" | 10 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 // represent a text fragment for example. | 33 // represent a text fragment for example. |
| 34 NGLayoutOpportunityIterator( | 34 NGLayoutOpportunityIterator( |
| 35 const NGConstraintSpace* space, | 35 const NGConstraintSpace* space, |
| 36 const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt, | 36 const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt, |
| 37 const WTF::Optional<NGLogicalOffset>& opt_leader_point = WTF::nullopt); | 37 const WTF::Optional<NGLogicalOffset>& opt_leader_point = WTF::nullopt); |
| 38 | 38 |
| 39 // Gets the next Layout Opportunity or nullptr if the search is exhausted. | 39 // Gets the next Layout Opportunity or nullptr if the search is exhausted. |
| 40 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. | 40 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. |
| 41 const NGLayoutOpportunity Next(); | 41 const NGLayoutOpportunity Next(); |
| 42 | 42 |
| 43 // Prints Layout Opportunity tree for debug purposes. | |
| 44 void ShowLayoutOpportunityTree() const; | |
|
cbiesinger
2017/03/06 19:56:02
Consider putting this in #ifndef NDEBUG like showL
Gleb Lanbin
2017/03/06 21:08:10
Done.
| |
| 45 | |
| 43 private: | 46 private: |
| 44 // Mutable Getters. | 47 // Mutable Getters. |
| 45 NGLayoutOpportunityTreeNode* MutableOpportunityTreeRoot() { | 48 NGLayoutOpportunityTreeNode* MutableOpportunityTreeRoot() { |
| 46 return opportunity_tree_root_.get(); | 49 return opportunity_tree_root_.get(); |
| 47 } | 50 } |
| 48 | 51 |
| 49 // Read-only Getters. | 52 // Read-only Getters. |
| 50 const NGLayoutOpportunityTreeNode* OpportunityTreeRoot() const { | 53 const NGLayoutOpportunityTreeNode* OpportunityTreeRoot() const { |
| 51 return opportunity_tree_root_.get(); | 54 return opportunity_tree_root_.get(); |
| 52 } | 55 } |
| 53 | 56 |
| 54 const NGConstraintSpace* constraint_space_; | 57 const NGConstraintSpace* constraint_space_; |
| 55 | 58 |
| 56 NGLayoutOpportunities opportunities_; | 59 NGLayoutOpportunities opportunities_; |
| 57 NGLayoutOpportunities::const_iterator opportunity_iter_; | 60 NGLayoutOpportunities::const_iterator opportunity_iter_; |
| 58 Persistent<NGLayoutOpportunityTreeNode> opportunity_tree_root_; | 61 Persistent<NGLayoutOpportunityTreeNode> opportunity_tree_root_; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 } // namespace blink | 64 } // namespace blink |
| 62 | 65 |
| 63 #endif // NGLayoutOpportunityIterator_h | 66 #endif // NGLayoutOpportunityIterator_h |
| OLD | NEW |