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 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" | 5 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode( | 9 NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode( |
10 const NGLogicalRect opportunity) | 10 const NGLogicalRect opportunity) |
11 : opportunity(opportunity), exclusion(nullptr) { | 11 : opportunity(opportunity), exclusion(nullptr) { |
12 exclusion_edge.start = opportunity.offset.inline_offset; | 12 exclusion_edge.start = opportunity.offset.inline_offset; |
13 exclusion_edge.end = exclusion_edge.start + opportunity.size.inline_size; | 13 exclusion_edge.end = exclusion_edge.start + opportunity.size.inline_size; |
14 } | 14 } |
15 | 15 |
16 NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode( | 16 NGLayoutOpportunityTreeNode::NGLayoutOpportunityTreeNode( |
17 const NGLogicalRect opportunity, | 17 const NGLogicalRect opportunity, |
18 NGEdge exclusion_edge) | 18 NGEdge exclusion_edge) |
19 : opportunity(opportunity), | 19 : opportunity(opportunity), |
20 exclusion_edge(exclusion_edge), | 20 exclusion_edge(exclusion_edge), |
21 exclusion(nullptr) {} | 21 exclusion(nullptr) {} |
22 | 22 |
| 23 String NGLayoutOpportunityTreeNode::ToString() const { |
| 24 return String::format( |
| 25 "Opportunity: '%s' Exclusion: '%s'", |
| 26 opportunity.ToString().ascii().data(), |
| 27 exclusion ? exclusion->ToString().ascii().data() : "null"); |
| 28 } |
| 29 |
23 DEFINE_TRACE(NGLayoutOpportunityTreeNode) { | 30 DEFINE_TRACE(NGLayoutOpportunityTreeNode) { |
24 visitor->trace(left); | 31 visitor->trace(left); |
25 visitor->trace(bottom); | 32 visitor->trace(bottom); |
26 visitor->trace(right); | 33 visitor->trace(right); |
27 } | 34 } |
28 | 35 |
29 } // namespace blink | 36 } // namespace blink |
OLD | NEW |