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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "core/rendering/RenderBlockFlow.h" | 27 #include "core/rendering/RenderBlockFlow.h" |
28 #include "platform/geometry/LayoutRect.h" | 28 #include "platform/geometry/LayoutRect.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 // Like LayoutState for layout(), LineLayoutState keeps track of global informat
ion | 32 // Like LayoutState for layout(), LineLayoutState keeps track of global informat
ion |
33 // during an entire linebox tree layout pass (aka layoutInlineChildren). | 33 // during an entire linebox tree layout pass (aka layoutInlineChildren). |
34 class LineLayoutState { | 34 class LineLayoutState { |
35 public: | 35 public: |
36 LineLayoutState(bool fullLayout, LayoutUnit& repaintLogicalTop, LayoutUnit&
repaintLogicalBottom, RenderFlowThread* flowThread) | 36 LineLayoutState(bool fullLayout, LayoutUnit& paintInvalidationLogicalTop, La
youtUnit& paintInvalidationLogicalBottom, RenderFlowThread* flowThread) |
37 : m_lastFloat(0) | 37 : m_lastFloat(0) |
38 , m_endLine(0) | 38 , m_endLine(0) |
39 , m_floatIndex(0) | 39 , m_floatIndex(0) |
40 , m_endLineLogicalTop(0) | 40 , m_endLineLogicalTop(0) |
41 , m_endLineMatched(false) | 41 , m_endLineMatched(false) |
42 , m_checkForFloatsFromLastLine(false) | 42 , m_checkForFloatsFromLastLine(false) |
43 , m_hasInlineChild(false) | 43 , m_hasInlineChild(false) |
44 , m_isFullLayout(fullLayout) | 44 , m_isFullLayout(fullLayout) |
45 , m_repaintLogicalTop(repaintLogicalTop) | 45 , m_paintInvalidationLogicalTop(paintInvalidationLogicalTop) |
46 , m_repaintLogicalBottom(repaintLogicalBottom) | 46 , m_paintInvalidationLogicalBottom(paintInvalidationLogicalBottom) |
47 , m_adjustedLogicalLineTop(0) | 47 , m_adjustedLogicalLineTop(0) |
48 , m_usesRepaintBounds(false) | 48 , m_usesPaintInvalidationBounds(false) |
49 , m_flowThread(flowThread) | 49 , m_flowThread(flowThread) |
50 { } | 50 { } |
51 | 51 |
52 void markForFullLayout() { m_isFullLayout = true; } | 52 void markForFullLayout() { m_isFullLayout = true; } |
53 bool isFullLayout() const { return m_isFullLayout; } | 53 bool isFullLayout() const { return m_isFullLayout; } |
54 | 54 |
55 bool usesRepaintBounds() const { return m_usesRepaintBounds; } | 55 bool usesPaintInvalidationBounds() const { return m_usesPaintInvalidationBou
nds; } |
56 | 56 |
57 void setRepaintRange(LayoutUnit logicalHeight) | 57 void setPaintInvalidationRange(LayoutUnit logicalHeight) |
58 { | 58 { |
59 m_usesRepaintBounds = true; | 59 m_usesPaintInvalidationBounds = true; |
60 m_repaintLogicalTop = m_repaintLogicalBottom = logicalHeight; | 60 m_paintInvalidationLogicalTop = m_paintInvalidationLogicalBottom = logic
alHeight; |
61 } | 61 } |
62 | 62 |
63 void updateRepaintRangeFromBox(RootInlineBox* box, LayoutUnit paginationDelt
a = 0) | 63 void updatePaintInvalidationRangeFromBox(RootInlineBox* box, LayoutUnit pagi
nationDelta = 0) |
64 { | 64 { |
65 m_usesRepaintBounds = true; | 65 m_usesPaintInvalidationBounds = true; |
66 m_repaintLogicalTop = std::min(m_repaintLogicalTop, box->logicalTopVisua
lOverflow() + std::min<LayoutUnit>(paginationDelta, 0)); | 66 m_paintInvalidationLogicalTop = std::min(m_paintInvalidationLogicalTop,
box->logicalTopVisualOverflow() + std::min<LayoutUnit>(paginationDelta, 0)); |
67 m_repaintLogicalBottom = std::max(m_repaintLogicalBottom, box->logicalBo
ttomVisualOverflow() + std::max<LayoutUnit>(paginationDelta, 0)); | 67 m_paintInvalidationLogicalBottom = std::max(m_paintInvalidationLogicalBo
ttom, box->logicalBottomVisualOverflow() + std::max<LayoutUnit>(paginationDelta,
0)); |
68 } | 68 } |
69 | 69 |
70 bool endLineMatched() const { return m_endLineMatched; } | 70 bool endLineMatched() const { return m_endLineMatched; } |
71 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc
hed; } | 71 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc
hed; } |
72 | 72 |
73 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin
e; } | 73 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin
e; } |
74 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin
e = check; } | 74 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin
e = check; } |
75 | 75 |
76 bool hasInlineChild() const { return m_hasInlineChild; } | 76 bool hasInlineChild() const { return m_hasInlineChild; } |
77 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh
ild; } | 77 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh
ild; } |
(...skipping 23 matching lines...) Expand all Loading... |
101 | 101 |
102 private: | 102 private: |
103 Vector<RenderBlockFlow::FloatWithRect> m_floats; | 103 Vector<RenderBlockFlow::FloatWithRect> m_floats; |
104 FloatingObject* m_lastFloat; | 104 FloatingObject* m_lastFloat; |
105 RootInlineBox* m_endLine; | 105 RootInlineBox* m_endLine; |
106 LineInfo m_lineInfo; | 106 LineInfo m_lineInfo; |
107 unsigned m_floatIndex; | 107 unsigned m_floatIndex; |
108 LayoutUnit m_endLineLogicalTop; | 108 LayoutUnit m_endLineLogicalTop; |
109 bool m_endLineMatched; | 109 bool m_endLineMatched; |
110 bool m_checkForFloatsFromLastLine; | 110 bool m_checkForFloatsFromLastLine; |
111 // Used as a performance optimization to avoid doing a full repaint when our
floats | 111 // Used as a performance optimization to avoid doing a full paint invalidati
on when our floats |
112 // change but we don't have any inline children. | 112 // change but we don't have any inline children. |
113 bool m_hasInlineChild; | 113 bool m_hasInlineChild; |
114 | 114 |
115 bool m_isFullLayout; | 115 bool m_isFullLayout; |
116 | 116 |
117 // FIXME: Should this be a range object instead of two ints? | 117 // FIXME: Should this be a range object instead of two ints? |
118 LayoutUnit& m_repaintLogicalTop; | 118 LayoutUnit& m_paintInvalidationLogicalTop; |
119 LayoutUnit& m_repaintLogicalBottom; | 119 LayoutUnit& m_paintInvalidationLogicalBottom; |
120 | 120 |
121 LayoutUnit m_adjustedLogicalLineTop; | 121 LayoutUnit m_adjustedLogicalLineTop; |
122 | 122 |
123 bool m_usesRepaintBounds; | 123 bool m_usesPaintInvalidationBounds; |
124 | 124 |
125 RenderFlowThread* m_flowThread; | 125 RenderFlowThread* m_flowThread; |
126 }; | 126 }; |
127 | 127 |
128 } | 128 } |
129 | 129 |
130 #endif // LineLayoutState_h | 130 #endif // LineLayoutState_h |
OLD | NEW |