OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "platform/geometry/LayoutRect.h" | 28 #include "platform/geometry/LayoutRect.h" |
29 #include "wtf/Allocator.h" | 29 #include "wtf/Allocator.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 // Like LayoutState for layout(), LineLayoutState keeps track of global informat
ion | 33 // Like LayoutState for layout(), LineLayoutState keeps track of global informat
ion |
34 // during an entire linebox tree layout pass (aka layoutInlineChildren). | 34 // during an entire linebox tree layout pass (aka layoutInlineChildren). |
35 class LineLayoutState { | 35 class LineLayoutState { |
36 STACK_ALLOCATED(); | 36 STACK_ALLOCATED(); |
37 public: | 37 public: |
38 LineLayoutState(bool fullLayout, LayoutUnit& paintInvalidationLogicalTop, La
youtUnit& paintInvalidationLogicalBottom, LayoutFlowThread* flowThread) | 38 LineLayoutState(bool fullLayout, LayoutUnit& paintInvalidationLogicalTop, La
youtUnit& paintInvalidationLogicalBottom) |
39 : m_lastFloat(nullptr) | 39 : m_lastFloat(nullptr) |
40 , m_endLine(nullptr) | 40 , m_endLine(nullptr) |
41 , m_floatIndex(0) | 41 , m_floatIndex(0) |
42 , m_endLineLogicalTop(0) | 42 , m_endLineLogicalTop(0) |
43 , m_endLineMatched(false) | 43 , m_endLineMatched(false) |
44 , m_hasInlineChild(false) | 44 , m_hasInlineChild(false) |
45 , m_isFullLayout(fullLayout) | 45 , m_isFullLayout(fullLayout) |
46 , m_paintInvalidationLogicalTop(paintInvalidationLogicalTop) | 46 , m_paintInvalidationLogicalTop(paintInvalidationLogicalTop) |
47 , m_paintInvalidationLogicalBottom(paintInvalidationLogicalBottom) | 47 , m_paintInvalidationLogicalBottom(paintInvalidationLogicalBottom) |
48 , m_usesPaintInvalidationBounds(false) | 48 , m_usesPaintInvalidationBounds(false) |
49 , m_flowThread(flowThread) | |
50 { } | 49 { } |
51 | 50 |
52 void markForFullLayout() { m_isFullLayout = true; } | 51 void markForFullLayout() { m_isFullLayout = true; } |
53 bool isFullLayout() const { return m_isFullLayout; } | 52 bool isFullLayout() const { return m_isFullLayout; } |
54 | 53 |
55 bool usesPaintInvalidationBounds() const { return m_usesPaintInvalidationBou
nds; } | 54 bool usesPaintInvalidationBounds() const { return m_usesPaintInvalidationBou
nds; } |
56 | 55 |
57 void setPaintInvalidationRange(LayoutUnit logicalHeight) | 56 void setPaintInvalidationRange(LayoutUnit logicalHeight) |
58 { | 57 { |
59 m_usesPaintInvalidationBounds = true; | 58 m_usesPaintInvalidationBounds = true; |
(...skipping 27 matching lines...) Expand all Loading... |
87 void setLastFloat(FloatingObject* lastFloat) { m_lastFloat = lastFloat; } | 86 void setLastFloat(FloatingObject* lastFloat) { m_lastFloat = lastFloat; } |
88 | 87 |
89 Vector<LayoutBlockFlow::FloatWithRect>& floats() { return m_floats; } | 88 Vector<LayoutBlockFlow::FloatWithRect>& floats() { return m_floats; } |
90 | 89 |
91 unsigned floatIndex() const { return m_floatIndex; } | 90 unsigned floatIndex() const { return m_floatIndex; } |
92 void setFloatIndex(unsigned floatIndex) { m_floatIndex = floatIndex; } | 91 void setFloatIndex(unsigned floatIndex) { m_floatIndex = floatIndex; } |
93 | 92 |
94 LayoutUnit adjustedLogicalLineTop() const { return m_adjustedLogicalLineTop;
} | 93 LayoutUnit adjustedLogicalLineTop() const { return m_adjustedLogicalLineTop;
} |
95 void setAdjustedLogicalLineTop(LayoutUnit value) { m_adjustedLogicalLineTop
= value; } | 94 void setAdjustedLogicalLineTop(LayoutUnit value) { m_adjustedLogicalLineTop
= value; } |
96 | 95 |
97 LayoutFlowThread* flowThread() const { return m_flowThread; } | |
98 | |
99 private: | 96 private: |
100 Vector<LayoutBlockFlow::FloatWithRect> m_floats; | 97 Vector<LayoutBlockFlow::FloatWithRect> m_floats; |
101 FloatingObject* m_lastFloat; | 98 FloatingObject* m_lastFloat; |
102 RootInlineBox* m_endLine; | 99 RootInlineBox* m_endLine; |
103 LineInfo m_lineInfo; | 100 LineInfo m_lineInfo; |
104 unsigned m_floatIndex; | 101 unsigned m_floatIndex; |
105 LayoutUnit m_endLineLogicalTop; | 102 LayoutUnit m_endLineLogicalTop; |
106 bool m_endLineMatched; | 103 bool m_endLineMatched; |
107 // Used as a performance optimization to avoid doing a full paint invalidati
on when our floats | 104 // Used as a performance optimization to avoid doing a full paint invalidati
on when our floats |
108 // change but we don't have any inline children. | 105 // change but we don't have any inline children. |
109 bool m_hasInlineChild; | 106 bool m_hasInlineChild; |
110 | 107 |
111 bool m_isFullLayout; | 108 bool m_isFullLayout; |
112 | 109 |
113 // FIXME: Should this be a range object instead of two ints? | 110 // FIXME: Should this be a range object instead of two ints? |
114 LayoutUnit& m_paintInvalidationLogicalTop; | 111 LayoutUnit& m_paintInvalidationLogicalTop; |
115 LayoutUnit& m_paintInvalidationLogicalBottom; | 112 LayoutUnit& m_paintInvalidationLogicalBottom; |
116 | 113 |
117 LayoutUnit m_adjustedLogicalLineTop; | 114 LayoutUnit m_adjustedLogicalLineTop; |
118 | 115 |
119 bool m_usesPaintInvalidationBounds; | 116 bool m_usesPaintInvalidationBounds; |
120 | |
121 LayoutFlowThread* m_flowThread; | |
122 }; | 117 }; |
123 | 118 |
124 } // namespace blink | 119 } // namespace blink |
125 | 120 |
126 #endif // LineLayoutState_h | 121 #endif // LineLayoutState_h |
OLD | NEW |