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

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

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl try Created 5 years, 1 month 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"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 bool canMapToContainer(const LayoutBoxModelObject* container) const 47 bool canMapToContainer(const LayoutBoxModelObject* container) const
48 { 48 {
49 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; 49 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner;
50 } 50 }
51 51
52 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details. 52 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details.
53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } 53 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); }
54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; } 54 Vector<LayoutObject*>& pendingDelayedPaintInvalidationTargets() { return m_p endingDelayedPaintInvalidations; }
55 55
56 // Disable view clipping and scroll offset adjustment for paint invalidation of FrameView scrollbars.
chrishtr 2015/11/11 01:40:29 Why? What goes wrong and why is it wrong now and n
Xianzhu 2015/11/11 19:29:57 Now we calculate paint invalidation rect for frame
57 // TODO(wangxianzhu): Remove this for root-layer-scrolls.
58 bool viewClippingAndScrollOffsetDisabled() const { return m_viewClippingAndS crollOffsetDisabled; }
59 void setViewClippingAndScrollOffsetDisabled(bool b) { m_viewClippingAndScrol lOffsetDisabled = b; }
60
56 private: 61 private:
57 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState); 62 PaintInvalidationState(const LayoutView&, Vector<LayoutObject*>& pendingDela yedPaintInvalidations, PaintInvalidationState* ownerPaintInvalidationState);
58 63
59 void applyClipIfNeeded(const LayoutObject&); 64 void applyClipIfNeeded(const LayoutObject&);
60 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize); 65 void addClipRectRelativeToPaintOffset(const LayoutSize& clipSize);
61 66
62 friend class ForceHorriblySlowRectMapping; 67 friend class ForceHorriblySlowRectMapping;
63 68
64 bool m_clipped; 69 bool m_clipped;
65 mutable bool m_cachedOffsetsEnabled; 70 mutable bool m_cachedOffsetsEnabled;
66 bool m_forcedSubtreeInvalidationWithinContainer; 71 bool m_forcedSubtreeInvalidationWithinContainer;
67 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer; 72 bool m_forcedSubtreeInvalidationRectUpdateWithinContainer;
73 bool m_viewClippingAndScrollOffsetDisabled;
68 74
69 LayoutRect m_clipRect; 75 LayoutRect m_clipRect;
70 76
71 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. 77 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets.
72 LayoutSize m_paintOffset; 78 LayoutSize m_paintOffset;
73 79
74 const LayoutBoxModelObject& m_paintInvalidationContainer; 80 const LayoutBoxModelObject& m_paintInvalidationContainer;
75 81
76 // Transform from the initial viewport coordinate system of an outermost 82 // Transform from the initial viewport coordinate system of an outermost
77 // SVG root to the userspace _before_ the relevant element. Combining this 83 // SVG root to the userspace _before_ the relevant element. Combining this
78 // with |m_paintOffset| yields the "final" offset. 84 // with |m_paintOffset| yields the "final" offset.
79 OwnPtr<AffineTransform> m_svgTransform; 85 OwnPtr<AffineTransform> m_svgTransform;
80 86
81 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations; 87 Vector<LayoutObject*>& m_pendingDelayedPaintInvalidations;
82 }; 88 };
83 89
84 } // namespace blink 90 } // namespace blink
85 91
86 #endif // PaintInvalidationState_h 92 #endif // PaintInvalidationState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698