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

Side by Side Diff: sky/engine/core/rendering/line/LineLayoutState.h

Issue 854563005: Remove some unused paint invalidation members from RenderObject. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: add a bit more Created 5 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
« no previous file with comments | « sky/engine/core/rendering/RenderParagraph.cpp ('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 /* 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
26 26
27 #include "sky/engine/core/rendering/RenderBlockFlow.h" 27 #include "sky/engine/core/rendering/RenderBlockFlow.h"
28 #include "sky/engine/platform/geometry/LayoutRect.h" 28 #include "sky/engine/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 RenderParagraph::layoutChildre n). 33 // during an entire linebox tree layout pass (aka RenderParagraph::layoutChildre n).
34 class LineLayoutState { 34 class LineLayoutState {
35 public: 35 public:
36 LineLayoutState(bool fullLayout, LayoutUnit& paintInvalidationLogicalTop, La youtUnit& paintInvalidationLogicalBottom) 36 LineLayoutState(bool fullLayout)
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_paintInvalidationLogicalTop(paintInvalidationLogicalTop)
46 , m_paintInvalidationLogicalBottom(paintInvalidationLogicalBottom)
47 , m_adjustedLogicalLineTop(0) 45 , m_adjustedLogicalLineTop(0)
48 , m_usesPaintInvalidationBounds(false)
49 { } 46 { }
50 47
51 void markForFullLayout() { m_isFullLayout = true; } 48 void markForFullLayout() { m_isFullLayout = true; }
52 bool isFullLayout() const { return m_isFullLayout; } 49 bool isFullLayout() const { return m_isFullLayout; }
53 50
54 bool usesPaintInvalidationBounds() const { return m_usesPaintInvalidationBou nds; }
55
56 void setPaintInvalidationRange(LayoutUnit logicalHeight)
57 {
58 m_usesPaintInvalidationBounds = true;
59 m_paintInvalidationLogicalTop = m_paintInvalidationLogicalBottom = logic alHeight;
60 }
61
62 void updatePaintInvalidationRangeFromBox(RootInlineBox* box, LayoutUnit pagi nationDelta = 0)
63 {
64 m_usesPaintInvalidationBounds = true;
65 m_paintInvalidationLogicalTop = std::min(m_paintInvalidationLogicalTop, box->logicalTopVisualOverflow() + std::min<LayoutUnit>(paginationDelta, 0));
66 m_paintInvalidationLogicalBottom = std::max(m_paintInvalidationLogicalBo ttom, box->logicalBottomVisualOverflow() + std::max<LayoutUnit>(paginationDelta, 0));
67 }
68
69 bool endLineMatched() const { return m_endLineMatched; } 51 bool endLineMatched() const { return m_endLineMatched; }
70 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; } 52 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; }
71 53
72 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin e; } 54 bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLin e; }
73 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin e = check; } 55 void setCheckForFloatsFromLastLine(bool check) { m_checkForFloatsFromLastLin e = check; }
74 56
75 bool hasInlineChild() const { return m_hasInlineChild; } 57 bool hasInlineChild() const { return m_hasInlineChild; }
76 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh ild; } 58 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh ild; }
77 59
78 LineInfo& lineInfo() { return m_lineInfo; } 60 LineInfo& lineInfo() { return m_lineInfo; }
(...skipping 24 matching lines...) Expand all
103 unsigned m_floatIndex; 85 unsigned m_floatIndex;
104 LayoutUnit m_endLineLogicalTop; 86 LayoutUnit m_endLineLogicalTop;
105 bool m_endLineMatched; 87 bool m_endLineMatched;
106 bool m_checkForFloatsFromLastLine; 88 bool m_checkForFloatsFromLastLine;
107 // Used as a performance optimization to avoid doing a full paint invalidati on when our floats 89 // 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. 90 // change but we don't have any inline children.
109 bool m_hasInlineChild; 91 bool m_hasInlineChild;
110 92
111 bool m_isFullLayout; 93 bool m_isFullLayout;
112 94
113 // FIXME: Should this be a range object instead of two ints?
114 LayoutUnit& m_paintInvalidationLogicalTop;
115 LayoutUnit& m_paintInvalidationLogicalBottom;
116
117 LayoutUnit m_adjustedLogicalLineTop; 95 LayoutUnit m_adjustedLogicalLineTop;
118
119 bool m_usesPaintInvalidationBounds;
120 }; 96 };
121 97
122 } 98 }
123 99
124 #endif // SKY_ENGINE_CORE_RENDERING_LINE_LINELAYOUTSTATE_H_ 100 #endif // SKY_ENGINE_CORE_RENDERING_LINE_LINELAYOUTSTATE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderParagraph.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698