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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp

Issue 2046233002: Revert of Don't include scroll offset in offsetFromLayoutObject for scrolling contents layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/paint/PaintInvalidationCapableScrollableArea.h" 5 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
6 6
7 #include "core/frame/Settings.h" 7 #include "core/frame/Settings.h"
8 #include "core/html/HTMLFrameOwnerElement.h" 8 #include "core/html/HTMLFrameOwnerElement.h"
9 #include "core/layout/LayoutBox.h" 9 #include "core/layout/LayoutBox.h"
10 #include "core/layout/LayoutScrollbar.h" 10 #include "core/layout/LayoutScrollbar.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // not width) but won't invalidate more than expected because in the false-p ositive case the box must 75 // not width) but won't invalidate more than expected because in the false-p ositive case the box must
76 // have changed size and have been invalidated. 76 // have changed size and have been invalidated.
77 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer(); 77 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer();
78 LayoutSize newScrollbarUsedSpaceInBox; 78 LayoutSize newScrollbarUsedSpaceInBox;
79 if (!isOverlay) 79 if (!isOverlay)
80 newScrollbarUsedSpaceInBox = newPaintInvalidationRect.size(); 80 newScrollbarUsedSpaceInBox = newPaintInvalidationRect.size();
81 LayoutSize previousScrollbarUsedSpaceInBox; 81 LayoutSize previousScrollbarUsedSpaceInBox;
82 if (!previouslyWasOverlay) 82 if (!previouslyWasOverlay)
83 previousScrollbarUsedSpaceInBox= previousPaintInvalidationRect.size(); 83 previousScrollbarUsedSpaceInBox= previousPaintInvalidationRect.size();
84 if (newScrollbarUsedSpaceInBox != previousScrollbarUsedSpaceInBox) 84 if (newScrollbarUsedSpaceInBox != previousScrollbarUsedSpaceInBox)
85 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(box, Pai ntInvalidationScroll, &box); 85 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(box, Pai ntInvalidationScroll);
86 86
87 bool invalidated = invalidatePaintOfScrollControlIfNeeded(newPaintInvalidati onRect, previousPaintInvalidationRect, needsPaintInvalidation, box, paintInvalid ationContainer); 87 bool invalidated = invalidatePaintOfScrollControlIfNeeded(newPaintInvalidati onRect, previousPaintInvalidationRect, needsPaintInvalidation, box, paintInvalid ationContainer);
88 88
89 previousPaintInvalidationRect = newPaintInvalidationRect; 89 previousPaintInvalidationRect = newPaintInvalidationRect;
90 previouslyWasOverlay = isOverlay; 90 previouslyWasOverlay = isOverlay;
91 91
92 if (!invalidated || !scrollbar || graphicsLayer) 92 if (!invalidated || !scrollbar || graphicsLayer)
93 return; 93 return;
94 94
95 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*scrollbar, PaintInvalidationScroll); 95 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*scrollbar, PaintInvalidationScroll);
(...skipping 29 matching lines...) Expand all
125 125
126 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts() const 126 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts() const
127 { 127 {
128 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect); 128 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect);
129 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect); 129 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect);
130 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect); 130 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect);
131 return fullBounds; 131 return fullBounds;
132 } 132 }
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698