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

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

Issue 1817693002: Support edge-inclusive intersections in mapToVisibleRectInAncestorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: Added IntersectionType flag and unit test for LayoutRect::inclusiveIntersect. Created 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PaintInvalidationState_h 5 #ifndef PaintInvalidationState_h
6 #define PaintInvalidationState_h 6 #define PaintInvalidationState_h
7 7
8 #include "platform/geometry/LayoutRect.h" 8 #include "platform/geometry/LayoutRect.h"
9 #include "platform/transforms/AffineTransform.h" 9 #include "platform/transforms/AffineTransform.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
11 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class LayoutBoxModelObject; 15 class LayoutBoxModelObject;
16 class LayoutObject; 16 class LayoutObject;
17 class LayoutSVGModelObject; 17 class LayoutSVGModelObject;
18 class LayoutView; 18 class LayoutView;
19 class PaintLayer; 19 class PaintLayer;
20 20
21 enum IntersectionFlags {
22 EdgeExclusive = 0,
eae 2016/03/22 17:54:16 We generally do not have a name for the 0 flag and
szager1 2016/03/22 19:42:24 Changed to DefaultVisibleRectFlags.
23 EdgeInclusive = 1
24 };
chrishtr 2016/03/22 17:25:49 Add typedef unsigned IntersectionFlags
szager1 2016/03/22 19:42:24 I changed it to: enum VisibleRectFlags { ...
25
21 // PaintInvalidationState is an optimization used during the paint 26 // PaintInvalidationState is an optimization used during the paint
22 // invalidation phase. 27 // invalidation phase.
23 // 28 //
24 // This class is extremely close to LayoutState so see the documentation 29 // This class is extremely close to LayoutState so see the documentation
25 // of LayoutState for the class existence and performance benefits. 30 // of LayoutState for the class existence and performance benefits.
26 // 31 //
27 // The main difference with LayoutState is that it was customized for the 32 // The main difference with LayoutState is that it was customized for the
28 // needs of the paint invalidation systems (keeping visual rectangles 33 // needs of the paint invalidation systems (keeping visual rectangles
29 // instead of layout specific information). 34 // instead of layout specific information).
30 class PaintInvalidationState { 35 class PaintInvalidationState {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 70
66 bool forcedSubtreeInvalidationRectUpdateWithinContainer() const { return m_f orcedSubtreeInvalidationRectUpdateWithinContainer; } 71 bool forcedSubtreeInvalidationRectUpdateWithinContainer() const { return m_f orcedSubtreeInvalidationRectUpdateWithinContainer; }
67 void setForceSubtreeInvalidationRectUpdateWithinContainer() { m_forcedSubtre eInvalidationRectUpdateWithinContainer = true; } 72 void setForceSubtreeInvalidationRectUpdateWithinContainer() { m_forcedSubtre eInvalidationRectUpdateWithinContainer = true; }
68 73
69 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa intInvalidationContainer; } 74 const LayoutBoxModelObject& paintInvalidationContainer() const { return m_pa intInvalidationContainer; }
70 75
71 bool canMapToAncestor(const LayoutBoxModelObject* ancestor) const 76 bool canMapToAncestor(const LayoutBoxModelObject* ancestor) const
72 { 77 {
73 return m_cachedOffsetsEnabled && ancestor == &m_paintInvalidationContain er; 78 return m_cachedOffsetsEnabled && ancestor == &m_paintInvalidationContain er;
74 } 79 }
75 void mapObjectRectToAncestor(const LayoutObject&, const LayoutBoxModelObject * ancestor, LayoutRect&) const; 80 bool mapObjectRectToAncestor(const LayoutObject&, const LayoutBoxModelObject * ancestor, LayoutRect&, int flags = 0) const;
76 81
77 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details. 82 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details.
78 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) const { m_pending DelayedPaintInvalidations.append(&obj); } 83 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) const { m_pending DelayedPaintInvalidations.append(&obj); }
79 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() const { retu rn m_pendingDelayedPaintInvalidations; } 84 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() const { retu rn m_pendingDelayedPaintInvalidations; }
80 85
81 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars. 86 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars.
82 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches. 87 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches.
83 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; } 88 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; }
84 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; } 89 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; }
85 90
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 m_paintInvalidationState->m_cachedOffsetsEnabled = true; 152 m_paintInvalidationState->m_cachedOffsetsEnabled = true;
148 } 153 }
149 private: 154 private:
150 const PaintInvalidationState* m_paintInvalidationState; 155 const PaintInvalidationState* m_paintInvalidationState;
151 bool m_didDisable; 156 bool m_didDisable;
152 }; 157 };
153 158
154 } // namespace blink 159 } // namespace blink
155 160
156 #endif // PaintInvalidationState_h 161 #endif // PaintInvalidationState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698