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

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

Issue 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 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 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 class ObjectPaintProperties; 68 class ObjectPaintProperties;
69 class PaintInvalidationState; 69 class PaintInvalidationState;
70 class PaintLayer; 70 class PaintLayer;
71 class PseudoStyleRequest; 71 class PseudoStyleRequest;
72 72
73 struct PaintInfo; 73 struct PaintInfo;
74 struct PaintInvalidatorContext; 74 struct PaintInvalidatorContext;
75 75
76 enum VisualRectFlags { DefaultVisualRectFlags = 0, EdgeInclusive = 1 }; 76 enum VisualRectFlags { DefaultVisualRectFlags = 0, EdgeInclusive = 1 };
77 77
78 enum RareDataReason {
79 // LayoutObject
80 ReasonLOAll,
81 ReasonLOInFlowSelfPaintingLayer,
82 ReasonLOInFlowSelfPaintingLayerDiffPC,
83 ReasonLOPreviousLocation,
84 ReasonLOFloatLayerBug1,
85 ReasonLOFloatLayerBug2,
86 ReasonLOSVGForeignBug,
87 // LayoutInline
88 ReasonLIAll,
89 ReasonLICreatesLineBoxes,
90 // LayoutText
91 ReasonLTAll,
92 ReasonLTCanUseParentVisualRect,
93 ReasonLTZeroOrOneLineBox,
94 ReasonLTZeroOrOneLineBoxCanUse,
95 // LayoutBox
96 ReasonLBAll,
97 ReasonLBRareData,
98 ReasonLBInlineBoxWrapper,
99 ReasonLBSpannerPlaceholder,
100 ReasonLBOverrideSize,
101 ReasonLBPageOffset,
102 ReasonLBPaginationStrut,
103 ReasonLBPreviousSize,
104 ReasonLBPreviousLayoutOverflow,
105 ReasonLBPreviousContentBox,
106 ReasonLBPreviousContentBoxSizeIfDiff,
107 ReasonLBPositionedContainer,
108 ReasonLBPositionedDiffPC,
109 ReasonLBPercentHeightContainer,
110 ReasonLBContentBoxDiff,
111 ReasonLBLayoutOverflowDiff,
112 // LayoutBlock
113 ReasonLBLAll,
114 ReasonLBLPositionedDescendants,
115 ReasonLBLPercentHeightDescendants,
116 // LayoutBlockFlow
117 ReasonLBFAll,
118 ReasonLBFRareData,
119 ReasonLBFPaginationStrutFromChild,
120 ReasonLBFLineBreakToAvoidWidow,
121 ReasonLBFDiscardMargin,
122 ReasonLBFMargin,
123 ReasonLBFMultiColumnFlowThread,
124 // LayoutTableSection
125 ReasonLTSAll,
126 ReasonLTSComposited,
127 ReasonLTSNonComposited,
128 ReasonLTSCompositedWithContainerBackground,
129 // LayoutTableRow
130 ReasonLTRAll,
131 ReasonLTRComposited,
132 ReasonLTRNonComposited,
133 ReasonLTRCompositedWithContainerBackground,
134 // LayoutTableCell
135 ReasonLTCAll,
136 ReasonLTCInvisibleCollapsedBorders,
137 ReasonLTCCollapsedBorders,
138 ReasonLTCComposited,
139 ReasonLTCNonComposited,
140 ReasonLTCCompositedWithContainerBackground,
141 // LocationOffset
142 ReasonLocationOffsetObject,
143 ReasonLocationOffsetBox,
144 ReasonLocationOffsetText,
145 ReasonLocationOffsetInline,
146 ReasonLocationOffsetSVG,
147
148 MaxReason,
149 ReasonNone = -1,
150 };
151
152 static_assert(MaxReason == 58, "keep consistent");
153
154 struct RareDataStat {
155 public:
156 RareDataStat() : m_reasons(0) {}
157 #if 0
158 ~RareDataStat()
159 {
160 for (int reason = 0; reason < MaxReason; ++reason) {
161 if (m_reasons & ((uint64_t)1 << reason))
162 s_reasonCounts[reason]--;
163 }
164 }
165 #endif
166
167 void addReason(RareDataReason reason) {
168 if (reason == ReasonNone)
169 return;
170 uint64_t reasonBit = (uint64_t)1 << reason;
171 if (!(m_reasons & reasonBit)) {
172 m_reasons |= reasonBit;
173 s_reasonCounts[reason]++;
174 }
175 }
176
177 uint64_t m_reasons;
178 static int s_reasonCounts[MaxReason];
179 };
180
78 enum CursorDirective { SetCursorBasedOnStyle, SetCursor, DoNotSetCursor }; 181 enum CursorDirective { SetCursorBasedOnStyle, SetCursor, DoNotSetCursor };
79 182
80 enum HitTestFilter { HitTestAll, HitTestSelf, HitTestDescendants }; 183 enum HitTestFilter { HitTestAll, HitTestSelf, HitTestDescendants };
81 184
82 enum MarkingBehavior { 185 enum MarkingBehavior {
83 MarkOnlyThis, 186 MarkOnlyThis,
84 MarkContainerChain, 187 MarkContainerChain,
85 }; 188 };
86 189
87 enum ScheduleRelayoutBehavior { ScheduleRelayout, DontScheduleRelayout }; 190 enum ScheduleRelayoutBehavior { ScheduleRelayout, DontScheduleRelayout };
(...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2557 // This stores the paint offset computed by the latest paint property tree 2660 // This stores the paint offset computed by the latest paint property tree
2558 // building. It is relative to the containing transform space. It is the same 2661 // building. It is relative to the containing transform space. It is the same
2559 // offset that will be used to paint the object on SPv2. It's used to detect 2662 // offset that will be used to paint the object on SPv2. It's used to detect
2560 // paint offset change for paint invalidation on SPv2, and partial paint 2663 // paint offset change for paint invalidation on SPv2, and partial paint
2561 // property tree update for SlimmingPaintInvalidation on SPv1 and SPv2. 2664 // property tree update for SlimmingPaintInvalidation on SPv1 and SPv2.
2562 LayoutPoint m_paintOffset; 2665 LayoutPoint m_paintOffset;
2563 2666
2564 // For SPv2 only. The ObjectPaintProperties structure holds references to the 2667 // For SPv2 only. The ObjectPaintProperties structure holds references to the
2565 // property tree nodes that are created by the layout object for painting. 2668 // property tree nodes that are created by the layout object for painting.
2566 std::unique_ptr<ObjectPaintProperties> m_paintProperties; 2669 std::unique_ptr<ObjectPaintProperties> m_paintProperties;
2670
2671 public:
2672 mutable RareDataStat m_rareStat;
2567 }; 2673 };
2568 2674
2569 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer 2675 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer
2570 // hit. 2676 // hit.
2571 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 2677 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
2572 STACK_ALLOCATED(); 2678 STACK_ALLOCATED();
2573 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 2679 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
2574 2680
2575 public: 2681 public:
2576 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 2682 DeprecatedDisableModifyLayoutTreeStructureAsserts();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2784 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2890 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2785 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2891 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2786 // We don't make object2 an optional parameter so that showLayoutTree 2892 // We don't make object2 an optional parameter so that showLayoutTree
2787 // can be called from gdb easily. 2893 // can be called from gdb easily.
2788 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2894 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2789 const blink::LayoutObject* object2); 2895 const blink::LayoutObject* object2);
2790 2896
2791 #endif 2897 #endif
2792 2898
2793 #endif // LayoutObject_h 2899 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698