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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.h

Issue 2798513002: Revert of Make GeometryMapper fully static (Closed)
Patch Set: Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 PaintInvalidator_h 5 #ifndef PaintInvalidator_h
6 #define PaintInvalidator_h 6 #define PaintInvalidator_h
7 7
8 #include "platform/geometry/LayoutRect.h" 8 #include "platform/geometry/LayoutRect.h"
9 #include "platform/graphics/paint/GeometryMapper.h"
9 #include "wtf/Vector.h" 10 #include "wtf/Vector.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class FrameView; 14 class FrameView;
14 class LayoutBoxModelObject; 15 class LayoutBoxModelObject;
15 class LayoutObject; 16 class LayoutObject;
16 class PaintLayer; 17 class PaintLayer;
17 struct PaintPropertyTreeBuilderContext; 18 struct PaintPropertyTreeBuilderContext;
18 19
19 struct PaintInvalidatorContext { 20 struct PaintInvalidatorContext {
20 PaintInvalidatorContext( 21 PaintInvalidatorContext(
21 const PaintPropertyTreeBuilderContext& treeBuilderContext) 22 const PaintPropertyTreeBuilderContext& treeBuilderContext,
22 : parentContext(nullptr), m_treeBuilderContext(treeBuilderContext) {} 23 GeometryMapper& geometryMapper)
24 : parentContext(nullptr),
25 m_treeBuilderContext(treeBuilderContext),
26 m_geometryMapper(geometryMapper) {}
23 27
24 PaintInvalidatorContext( 28 PaintInvalidatorContext(
25 const PaintPropertyTreeBuilderContext& treeBuilderContext, 29 const PaintPropertyTreeBuilderContext& treeBuilderContext,
26 const PaintInvalidatorContext& parentContext) 30 const PaintInvalidatorContext& parentContext)
27 : parentContext(&parentContext), 31 : parentContext(&parentContext),
28 forcedSubtreeInvalidationFlags( 32 forcedSubtreeInvalidationFlags(
29 parentContext.forcedSubtreeInvalidationFlags), 33 parentContext.forcedSubtreeInvalidationFlags),
30 paintInvalidationContainer(parentContext.paintInvalidationContainer), 34 paintInvalidationContainer(parentContext.paintInvalidationContainer),
31 paintInvalidationContainerForStackedContents( 35 paintInvalidationContainerForStackedContents(
32 parentContext.paintInvalidationContainerForStackedContents), 36 parentContext.paintInvalidationContainerForStackedContents),
33 paintingLayer(parentContext.paintingLayer), 37 paintingLayer(parentContext.paintingLayer),
34 m_treeBuilderContext(treeBuilderContext) {} 38 m_treeBuilderContext(treeBuilderContext),
39 m_geometryMapper(parentContext.m_geometryMapper) {}
35 40
36 // This method is virtual temporarily to adapt PaintInvalidatorContext and the 41 // This method is virtual temporarily to adapt PaintInvalidatorContext and the
37 // legacy PaintInvalidationState for code shared by old code and new code. 42 // legacy PaintInvalidationState for code shared by old code and new code.
38 virtual void mapLocalRectToVisualRectInBacking(const LayoutObject&, 43 virtual void mapLocalRectToVisualRectInBacking(const LayoutObject&,
39 LayoutRect&) const; 44 LayoutRect&) const;
40 45
41 const PaintInvalidatorContext* parentContext; 46 const PaintInvalidatorContext* parentContext;
42 47
43 enum ForcedSubtreeInvalidationFlag { 48 enum ForcedSubtreeInvalidationFlag {
44 ForcedSubtreeInvalidationChecking = 1 << 0, 49 ForcedSubtreeInvalidationChecking = 1 << 0,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // invalidation backing's coordinates. They are used to detect layoutObject 95 // invalidation backing's coordinates. They are used to detect layoutObject
91 // shifts that force a full invalidation and invalidation check in subtree. 96 // shifts that force a full invalidation and invalidation check in subtree.
92 // The points do *not* account for composited scrolling. See 97 // The points do *not* account for composited scrolling. See
93 // LayoutObject::adjustVisualRectForCompositedScrolling(). 98 // LayoutObject::adjustVisualRectForCompositedScrolling().
94 LayoutPoint oldLocation; 99 LayoutPoint oldLocation;
95 LayoutPoint newLocation; 100 LayoutPoint newLocation;
96 101
97 private: 102 private:
98 friend class PaintInvalidator; 103 friend class PaintInvalidator;
99 const PaintPropertyTreeBuilderContext& m_treeBuilderContext; 104 const PaintPropertyTreeBuilderContext& m_treeBuilderContext;
105 GeometryMapper& m_geometryMapper;
100 }; 106 };
101 107
102 class PaintInvalidator { 108 class PaintInvalidator {
103 public: 109 public:
104 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); 110 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&);
105 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); 111 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&);
106 112
107 // Process objects needing paint invalidation on the next frame. 113 // Process objects needing paint invalidation on the next frame.
108 // See the definition of PaintInvalidationDelayedFull for more details. 114 // See the definition of PaintInvalidationDelayedFull for more details.
109 void processPendingDelayedPaintInvalidations(); 115 void processPendingDelayedPaintInvalidations();
(...skipping 17 matching lines...) Expand all
127 PaintInvalidatorContext&); 133 PaintInvalidatorContext&);
128 ALWAYS_INLINE void updateVisualRect(const LayoutObject&, 134 ALWAYS_INLINE void updateVisualRect(const LayoutObject&,
129 PaintInvalidatorContext&); 135 PaintInvalidatorContext&);
130 136
131 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; 137 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations;
132 }; 138 };
133 139
134 } // namespace blink 140 } // namespace blink
135 141
136 #endif // PaintInvalidator_h 142 #endif // PaintInvalidator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698