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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/LineLayoutState.h

Issue 2087513003: Remove LayoutBlockFlow overflow invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NeedsRebaseline Created 4 years, 5 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
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 17 matching lines...) Expand all
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) 38 LineLayoutState(bool fullLayout)
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_endLineMatched(false) 42 , m_endLineMatched(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_usesPaintInvalidationBounds(false)
48 { } 45 { }
49 46
50 void markForFullLayout() { m_isFullLayout = true; } 47 void markForFullLayout() { m_isFullLayout = true; }
51 bool isFullLayout() const { return m_isFullLayout; } 48 bool isFullLayout() const { return m_isFullLayout; }
52 49
53 bool usesPaintInvalidationBounds() const { return m_usesPaintInvalidationBou nds; }
54
55 void setPaintInvalidationRange(LayoutUnit logicalHeight)
56 {
57 m_usesPaintInvalidationBounds = true;
58 m_paintInvalidationLogicalTop = m_paintInvalidationLogicalBottom = logic alHeight;
59 }
60
61 void updatePaintInvalidationRangeFromBox(RootInlineBox* box, LayoutUnit pagi nationDelta = LayoutUnit())
62 {
63 m_usesPaintInvalidationBounds = true;
64 m_paintInvalidationLogicalTop = std::min(m_paintInvalidationLogicalTop, box->logicalTopVisualOverflow() + paginationDelta.clampPositiveToZero());
65 m_paintInvalidationLogicalBottom = std::max(m_paintInvalidationLogicalBo ttom, box->logicalBottomVisualOverflow() + paginationDelta.clampNegativeToZero() );
66 }
67
68 bool endLineMatched() const { return m_endLineMatched; } 50 bool endLineMatched() const { return m_endLineMatched; }
69 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; } 51 void setEndLineMatched(bool endLineMatched) { m_endLineMatched = endLineMatc hed; }
70 52
71 bool hasInlineChild() const { return m_hasInlineChild; } 53 bool hasInlineChild() const { return m_hasInlineChild; }
72 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh ild; } 54 void setHasInlineChild(bool hasInlineChild) { m_hasInlineChild = hasInlineCh ild; }
73 55
74 56
75 LineInfo& lineInfo() { return m_lineInfo; } 57 LineInfo& lineInfo() { return m_lineInfo; }
76 const LineInfo& lineInfo() const { return m_lineInfo; } 58 const LineInfo& lineInfo() const { return m_lineInfo; }
77 59
(...skipping 21 matching lines...) Expand all
99 LineInfo m_lineInfo; 81 LineInfo m_lineInfo;
100 unsigned m_floatIndex; 82 unsigned m_floatIndex;
101 LayoutUnit m_endLineLogicalTop; 83 LayoutUnit m_endLineLogicalTop;
102 bool m_endLineMatched; 84 bool m_endLineMatched;
103 // Used as a performance optimization to avoid doing a full paint invalidati on when our floats 85 // Used as a performance optimization to avoid doing a full paint invalidati on when our floats
104 // change but we don't have any inline children. 86 // change but we don't have any inline children.
105 bool m_hasInlineChild; 87 bool m_hasInlineChild;
106 88
107 bool m_isFullLayout; 89 bool m_isFullLayout;
108 90
109 // FIXME: Should this be a range object instead of two ints?
110 LayoutUnit& m_paintInvalidationLogicalTop;
111 LayoutUnit& m_paintInvalidationLogicalBottom;
112
113 LayoutUnit m_adjustedLogicalLineTop; 91 LayoutUnit m_adjustedLogicalLineTop;
114
115 bool m_usesPaintInvalidationBounds;
116 }; 92 };
117 93
118 } // namespace blink 94 } // namespace blink
119 95
120 #endif // LineLayoutState_h 96 #endif // LineLayoutState_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.cpp ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698