| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 bool needsPaintInvalidation = needsPaintInvalidationArg; | 60 bool needsPaintInvalidation = needsPaintInvalidationArg; |
| 61 if (graphicsLayer) { | 61 if (graphicsLayer) { |
| 62 // If the scrollbar needs paint invalidation but didn't change location/
size or the scrollbar is an | 62 // If the scrollbar needs paint invalidation but didn't change location/
size or the scrollbar is an |
| 63 // overlay scrollbar (paint invalidation rect is empty), invalidating th
e graphics layer is enough | 63 // overlay scrollbar (paint invalidation rect is empty), invalidating th
e graphics layer is enough |
| 64 // (which has been done in ScrollableArea::setScrollbarNeedsPaintInvalid
ation()). | 64 // (which has been done in ScrollableArea::setScrollbarNeedsPaintInvalid
ation()). |
| 65 // Otherwise invalidatePaintOfScrollControlIfNeeded() below will invalid
ate the old and new location | 65 // Otherwise invalidatePaintOfScrollControlIfNeeded() below will invalid
ate the old and new location |
| 66 // of the scrollbar on the box's paint invalidation container to ensure
newly expanded/shrunk areas | 66 // of the scrollbar on the box's paint invalidation container to ensure
newly expanded/shrunk areas |
| 67 // of the box to be invalidated. | 67 // of the box to be invalidated. |
| 68 needsPaintInvalidation = false; | 68 needsPaintInvalidation = false; |
| 69 |
| 70 graphicsLayer->invalidateDisplayItemClient(*graphicsLayer, PaintInvalida
tionScroll); |
| 69 } | 71 } |
| 70 | 72 |
| 71 // Invalidate the box's display item client if the box's padding box size is
affected by change of the | 73 // Invalidate the box's display item client if the box's padding box size is
affected by change of the |
| 72 // non-overlay scrollbar width. We detect change of paint invalidation rect
size instead of change of | 74 // non-overlay scrollbar width. We detect change of paint invalidation rect
size instead of change of |
| 73 // scrollbar width change, which may have some false-positives (e.g. the scr
ollbar changed length but | 75 // scrollbar width change, which may have some false-positives (e.g. the scr
ollbar changed length but |
| 74 // not width) but won't invalidate more than expected because in the false-p
ositive case the box must | 76 // not width) but won't invalidate more than expected because in the false-p
ositive case the box must |
| 75 // have changed size and have been invalidated. | 77 // have changed size and have been invalidated. |
| 76 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt
ate.paintInvalidationContainer(); | 78 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt
ate.paintInvalidationContainer(); |
| 77 LayoutSize newScrollbarUsedSpaceInBox; | 79 LayoutSize newScrollbarUsedSpaceInBox; |
| 78 if (!isOverlay) | 80 if (!isOverlay) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 126 |
| 125 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts()
const | 127 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts()
const |
| 126 { | 128 { |
| 127 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect); | 129 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect); |
| 128 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect); | 130 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect); |
| 129 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect); | 131 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect); |
| 130 return fullBounds; | 132 return fullBounds; |
| 131 } | 133 } |
| 132 | 134 |
| 133 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |