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

Side by Side Diff: Source/core/rendering/line/LineLayoutState.h

Issue 145083009: Remove unnecessary repaint from line layout and cleanup logic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
OLDNEW
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 24 matching lines...) Expand all
35 // during an entire linebox tree layout pass (aka layoutInlineChildren). 35 // during an entire linebox tree layout pass (aka layoutInlineChildren).
36 class LineLayoutState { 36 class LineLayoutState {
37 public: 37 public:
38 LineLayoutState(bool fullLayout, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom, RenderFlowThread* flowThread) 38 LineLayoutState(bool fullLayout, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom, RenderFlowThread* flowThread)
39 : m_lastFloat(0) 39 : m_lastFloat(0)
40 , m_endLine(0) 40 , m_endLine(0)
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_checkForFloatsFromLastLine(false) 44 , m_checkForFloatsFromLastLine(false)
45 , m_hasInlineChild(false)
45 , m_isFullLayout(fullLayout) 46 , m_isFullLayout(fullLayout)
46 , m_repaintLogicalTop(repaintLogicalTop) 47 , m_repaintLogicalTop(repaintLogicalTop)
47 , m_repaintLogicalBottom(repaintLogicalBottom) 48 , m_repaintLogicalBottom(repaintLogicalBottom)
48 , m_adjustedLogicalLineTop(0) 49 , m_adjustedLogicalLineTop(0)
49 , m_usesRepaintBounds(false) 50 , m_usesRepaintBounds(false)
50 , m_flowThread(flowThread) 51 , m_flowThread(flowThread)
51 { } 52 { }
52 53
53 void markForFullLayout() { m_isFullLayout = true; } 54 void markForFullLayout() { m_isFullLayout = true; }
54 bool isFullLayout() const { return m_isFullLayout; } 55 bool isFullLayout() const { return m_isFullLayout; }
(...skipping 12 matching lines...) Expand all
67 m_repaintLogicalTop = std::min(m_repaintLogicalTop, box->logicalTopVisua lOverflow() + std::min<LayoutUnit>(paginationDelta, 0)); 68 m_repaintLogicalTop = std::min(m_repaintLogicalTop, box->logicalTopVisua lOverflow() + std::min<LayoutUnit>(paginationDelta, 0));
68 m_repaintLogicalBottom = std::max(m_repaintLogicalBottom, box->logicalBo ttomVisualOverflow() + std::max<LayoutUnit>(paginationDelta, 0)); 69 m_repaintLogicalBottom = std::max(m_repaintLogicalBottom, box->logicalBo ttomVisualOverflow() + std::max<LayoutUnit>(paginationDelta, 0));
69 } 70 }
70 71
71 bool endLineMatched() const { return m_endLineMatched; } 72 bool endLineMatched() const { return m_endLineMatched; }
72 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; } 73 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; }
73 74
74 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin e; } 75 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin e; }
75 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin e = check; } 76 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin e = check; }
76 77
78 bool hasInlineChild() const { return m_hasInlineChild; }
79 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh ild; }
80
77 LineInfo& lineInfo() { return m_lineInfo; } 81 LineInfo& lineInfo() { return m_lineInfo; }
78 const LineInfo& lineInfo() const { return m_lineInfo; } 82 const LineInfo& lineInfo() const { return m_lineInfo; }
79 83
80 LayoutUnit endLineLogicalTop() const { return m_endLineLogicalTop; } 84 LayoutUnit endLineLogicalTop() const { return m_endLineLogicalTop; }
81 void setEndLineLogicalTop(LayoutUnit logicalTop) { m_endLineLogicalTop = log icalTop; } 85 void setEndLineLogicalTop(LayoutUnit logicalTop) { m_endLineLogicalTop = log icalTop; }
82 86
83 RootInlineBox* endLine() const { return m_endLine; } 87 RootInlineBox* endLine() const { return m_endLine; }
84 void setEndLine(RootInlineBox* line) { m_endLine = line; } 88 void setEndLine(RootInlineBox* line) { m_endLine = line; }
85 89
86 FloatingObject* lastFloat() const { return m_lastFloat; } 90 FloatingObject* lastFloat() const { return m_lastFloat; }
(...skipping 12 matching lines...) Expand all
99 103
100 private: 104 private:
101 Vector<RenderBlockFlow::FloatWithRect> m_floats; 105 Vector<RenderBlockFlow::FloatWithRect> m_floats;
102 FloatingObject* m_lastFloat; 106 FloatingObject* m_lastFloat;
103 RootInlineBox* m_endLine; 107 RootInlineBox* m_endLine;
104 LineInfo m_lineInfo; 108 LineInfo m_lineInfo;
105 unsigned m_floatIndex; 109 unsigned m_floatIndex;
106 LayoutUnit m_endLineLogicalTop; 110 LayoutUnit m_endLineLogicalTop;
107 bool m_endLineMatched; 111 bool m_endLineMatched;
108 bool m_checkForFloatsFromLastLine; 112 bool m_checkForFloatsFromLastLine;
113 // Used as a performance optimization to avoid doing a full repaint when our floats
114 // change but we don't have any inline children.
115 bool m_hasInlineChild;
109 116
110 bool m_isFullLayout; 117 bool m_isFullLayout;
111 118
112 // FIXME: Should this be a range object instead of two ints? 119 // FIXME: Should this be a range object instead of two ints?
113 LayoutUnit& m_repaintLogicalTop; 120 LayoutUnit& m_repaintLogicalTop;
114 LayoutUnit& m_repaintLogicalBottom; 121 LayoutUnit& m_repaintLogicalBottom;
115 122
116 LayoutUnit m_adjustedLogicalLineTop; 123 LayoutUnit m_adjustedLogicalLineTop;
117 124
118 bool m_usesRepaintBounds; 125 bool m_usesRepaintBounds;
119 126
120 RenderFlowThread* m_flowThread; 127 RenderFlowThread* m_flowThread;
121 }; 128 };
122 129
123 } 130 }
124 131
125 #endif // LineLayoutState_h 132 #endif // LineLayoutState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698