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 NGInlineLayoutAlgorithm_h | 5 #ifndef NGInlineLayoutAlgorithm_h |
6 #define NGInlineLayoutAlgorithm_h | 6 #define NGInlineLayoutAlgorithm_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/ng_layout_algorithm.h" | 9 #include "core/layout/ng/ng_layout_algorithm.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class CORE_EXPORT NGTextLayoutAlgorithm : public NGLayoutAlgorithm { | 24 class CORE_EXPORT NGTextLayoutAlgorithm : public NGLayoutAlgorithm { |
25 public: | 25 public: |
26 // Default constructor. | 26 // Default constructor. |
27 // @param inline_box The inline box to produce fragments from. | 27 // @param inline_box The inline box to produce fragments from. |
28 // @param space The constraint space which the algorithm should generate a | 28 // @param space The constraint space which the algorithm should generate a |
29 // fragments within. | 29 // fragments within. |
30 NGTextLayoutAlgorithm(NGInlineNode* inline_box, | 30 NGTextLayoutAlgorithm(NGInlineNode* inline_box, |
31 NGConstraintSpace* space, | 31 NGConstraintSpace* space, |
32 NGBreakToken* break_token = nullptr); | 32 NGBreakToken* break_token = nullptr); |
33 | 33 |
34 NGLayoutStatus Layout(NGPhysicalFragment*, | 34 NGPhysicalFragment* Layout() override; |
35 NGPhysicalFragment**, | |
36 NGLayoutAlgorithm**) override; | |
37 bool LayoutInline(NGLineBuilder*); | 35 bool LayoutInline(NGLineBuilder*); |
38 | 36 |
39 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
40 | 38 |
41 private: | 39 private: |
42 Member<NGInlineNode> inline_box_; | 40 Member<NGInlineNode> inline_box_; |
43 Member<NGConstraintSpace> constraint_space_; | 41 Member<NGConstraintSpace> constraint_space_; |
44 Member<NGBreakToken> break_token_; | 42 Member<NGBreakToken> break_token_; |
45 | 43 |
46 friend class NGInlineNodeTest; | 44 friend class NGInlineNodeTest; |
47 }; | 45 }; |
48 | 46 |
49 DEFINE_TYPE_CASTS(NGTextLayoutAlgorithm, | 47 DEFINE_TYPE_CASTS(NGTextLayoutAlgorithm, |
50 NGLayoutAlgorithm, | 48 NGLayoutAlgorithm, |
51 algorithm, | 49 algorithm, |
52 algorithm->algorithmType() == kTextLayoutAlgorithm, | 50 algorithm->algorithmType() == kTextLayoutAlgorithm, |
53 algorithm.algorithmType() == kTextLayoutAlgorithm); | 51 algorithm.algorithmType() == kTextLayoutAlgorithm); |
54 | 52 |
55 } // namespace blink | 53 } // namespace blink |
56 | 54 |
57 #endif // NGInlineLayoutAlgorithm_h | 55 #endif // NGInlineLayoutAlgorithm_h |
OLD | NEW |