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

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

Issue 1585823002: Improve performance when calling PaintLayer::setNeedsRepaint() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RemoveVisualRect
Patch Set: Created 4 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
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 20
20 // PaintInvalidationState is an optimization used during the paint 21 // PaintInvalidationState is an optimization used during the paint
21 // invalidation phase. 22 // invalidation phase.
22 // 23 //
23 // This class is extremely close to LayoutState so see the documentation 24 // This class is extremely close to LayoutState so see the documentation
24 // of LayoutState for the class existence and performance benefits. 25 // of LayoutState for the class existence and performance benefits.
25 // 26 //
26 // The main difference with LayoutState is that it was customized for the 27 // The main difference with LayoutState is that it was customized for the
27 // needs of the paint invalidation systems (keeping visual rectangles 28 // needs of the paint invalidation systems (keeping visual rectangles
28 // instead of layout specific information). 29 // instead of layout specific information).
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 61
61 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details. 62 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details.
62 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } 63 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); }
63 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } 64 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; }
64 65
65 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars. 66 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars.
66 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches. 67 // TODO(wangxianzhu): Remove this when root-layer-scrolls launches.
67 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; } 68 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; }
68 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; } 69 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; }
69 70
71 PaintLayer& enclosingLayer(const LayoutObject&) const;
72
70 private: 73 private:
71 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); 74 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState);
72 75
73 void applyClipIfNeeded(const LayoutObject&); 76 void applyClipIfNeeded(const LayoutObject&);
74 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); 77 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize);
75 78
76 friend class ForceHorriblySlowRectMapping; 79 friend class ForceHorriblySlowRectMapping;
77 80
78 bool m_clipped; 81 bool m_clipped;
79 mutable bool m_cachedOffsetsEnabled; 82 mutable bool m_cachedOffsetsEnabled;
(...skipping 10 matching lines...) Expand all
90 // 93 //
91 // It is the enclosing composited object. 94 // It is the enclosing composited object.
92 const LayoutBoxModelObject& m_paintInvalidationContainer; 95 const LayoutBoxModelObject& m_paintInvalidationContainer;
93 96
94 // Transform from the initial viewport coordinate system of an outermost 97 // Transform from the initial viewport coordinate system of an outermost
95 // SVG root to the userspace _before_ the relevant element. Combining this 98 // SVG root to the userspace _before_ the relevant element. Combining this
96 // with |m_paintOffset| yields the "final" offset. 99 // with |m_paintOffset| yields the "final" offset.
97 AffineTransform m_svgTransform; 100 AffineTransform m_svgTransform;
98 101
99 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; 102 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations;
103
104 PaintLayer& m_enclosingLayer;
100 }; 105 };
101 106
102 } // namespace blink 107 } // namespace blink
103 108
104 #endif // PaintInvalidationState_h 109 #endif // PaintInvalidationState_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698