Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc

Issue 2515923002: Remove redundant 'derived constraint space' setters from NGConstraintSpace (Closed)
Patch Set: sync to the head Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_iterator.h" 5 #include "core/layout/ng/ng_layout_opportunity_iterator.h"
6 6
7 #include "core/layout/ng/ng_physical_constraint_space.h" 7 #include "core/layout/ng/ng_physical_constraint_space.h"
8 #include "core/layout/ng/ng_units.h" 8 #include "core/layout/ng/ng_units.h"
9 #include "wtf/NonCopyingSort.h" 9 #include "wtf/NonCopyingSort.h"
10 10
(...skipping 11 matching lines...) Expand all
22 CollectAllOpportunities(node->bottom, opportunities); 22 CollectAllOpportunities(node->bottom, opportunities);
23 CollectAllOpportunities(node->right, opportunities); 23 CollectAllOpportunities(node->right, opportunities);
24 } 24 }
25 25
26 // Creates layout opportunity from the provided space and the origin point. 26 // Creates layout opportunity from the provided space and the origin point.
27 NGLayoutOpportunity CreateLayoutOpportunityFromConstraintSpace( 27 NGLayoutOpportunity CreateLayoutOpportunityFromConstraintSpace(
28 const NGConstraintSpace& space, 28 const NGConstraintSpace& space,
29 const NGLogicalOffset& origin_point) { 29 const NGLogicalOffset& origin_point) {
30 NGLayoutOpportunity opportunity; 30 NGLayoutOpportunity opportunity;
31 opportunity.offset = space.Offset(); 31 opportunity.offset = space.Offset();
32 opportunity.size = space.Size(); 32 opportunity.size = space.AvailableSize();
33 33
34 // adjust to the origin_point. 34 // adjust to the origin_point.
35 opportunity.offset += origin_point; 35 opportunity.offset += origin_point;
36 opportunity.size.inline_size -= origin_point.inline_offset; 36 opportunity.size.inline_size -= origin_point.inline_offset;
37 opportunity.size.block_size -= origin_point.block_offset; 37 opportunity.size.block_size -= origin_point.block_offset;
38 return opportunity; 38 return opportunity;
39 } 39 }
40 40
41 // Whether 2 edges overlap with each other. 41 // Whether 2 edges overlap with each other.
42 bool IsOverlapping(const NGEdge& edge1, const NGEdge& edge2) { 42 bool IsOverlapping(const NGEdge& edge1, const NGEdge& edge2) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 const NGLayoutOpportunity NGLayoutOpportunityIterator::Next() { 287 const NGLayoutOpportunity NGLayoutOpportunityIterator::Next() {
288 if (opportunity_iter_ == opportunities_.end()) 288 if (opportunity_iter_ == opportunities_.end())
289 return NGLayoutOpportunity(); 289 return NGLayoutOpportunity();
290 auto* opportunity = opportunity_iter_; 290 auto* opportunity = opportunity_iter_;
291 opportunity_iter_++; 291 opportunity_iter_++;
292 return NGLayoutOpportunity(*opportunity); 292 return NGLayoutOpportunity(*opportunity);
293 } 293 }
294 294
295 } // namespace blink 295 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698