| 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 "config.h" | 5 #include "config.h" | 
| 6 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 6 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 
| 7 | 7 | 
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" | 
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" | 
| 10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 42         shouldInvalidateNewRect = true; | 42         shouldInvalidateNewRect = true; | 
| 43     } | 43     } | 
| 44     if (shouldInvalidateNewRect) { | 44     if (shouldInvalidateNewRect) { | 
| 45         box.invalidatePaintUsingContainer(paintInvalidationContainer, newPaintIn
     validationRect, PaintInvalidationScroll); | 45         box.invalidatePaintUsingContainer(paintInvalidationContainer, newPaintIn
     validationRect, PaintInvalidationScroll); | 
| 46         box.enclosingLayer()->setNeedsRepaint(); | 46         box.enclosingLayer()->setNeedsRepaint(); | 
| 47         return true; | 47         return true; | 
| 48     } | 48     } | 
| 49     return false; | 49     return false; | 
| 50 } | 50 } | 
| 51 | 51 | 
| 52 struct ScrollbarPaintInvalidationData { |  | 
| 53     Scrollbar* scrollbar; |  | 
| 54     GraphicsLayer* graphicsLayer; |  | 
| 55     LayoutRect& previousPaintInvalidatioRect; |  | 
| 56 |  | 
| 57 }; |  | 
| 58 |  | 
| 59 static void invalidatePaintOfScrollbarIfNeeded(Scrollbar* scrollbar, GraphicsLay
     er* graphicsLayer, bool& previouslyWasOverlay, LayoutRect& previousPaintInvalida
     tionRect, bool needsPaintInvalidationArg, LayoutBox& box, const PaintInvalidatio
     nState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationCon
     tainer) | 52 static void invalidatePaintOfScrollbarIfNeeded(Scrollbar* scrollbar, GraphicsLay
     er* graphicsLayer, bool& previouslyWasOverlay, LayoutRect& previousPaintInvalida
     tionRect, bool needsPaintInvalidationArg, LayoutBox& box, const PaintInvalidatio
     nState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationCon
     tainer) | 
| 60 { | 53 { | 
| 61     bool isOverlay = scrollbar && scrollbar->isOverlayScrollbar(); | 54     bool isOverlay = scrollbar && scrollbar->isOverlayScrollbar(); | 
| 62 | 55 | 
| 63     // Calculate paint invalidation rect of the scrollbar, except overlay compos
     ited scrollbars because we invalidate the graphics layer only. | 56     // Calculate paint invalidation rect of the scrollbar, except overlay compos
     ited scrollbars because we invalidate the graphics layer only. | 
| 64     LayoutRect newPaintInvalidationRect; | 57     LayoutRect newPaintInvalidationRect; | 
| 65     if (scrollbar && !(graphicsLayer && isOverlay)) | 58     if (scrollbar && !(graphicsLayer && isOverlay)) | 
| 66         newPaintInvalidationRect = scrollControlPaintInvalidationRect(scrollbar-
     >frameRect(), box, paintInvalidationState, paintInvalidationContainer); | 59         newPaintInvalidationRect = scrollControlPaintInvalidationRect(scrollbar-
     >frameRect(), box, paintInvalidationState, paintInvalidationContainer); | 
| 67 | 60 | 
| 68     bool needsPaintInvalidation = needsPaintInvalidationArg; | 61     bool needsPaintInvalidation = needsPaintInvalidationArg; | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 123 } | 116 } | 
| 124 | 117 | 
| 125 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
     () | 118 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
     () | 
| 126 { | 119 { | 
| 127     m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 120     m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 
| 128     m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 121     m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 
| 129     m_scrollCornerPreviousPaintInvalidationRect = LayoutRect(); | 122     m_scrollCornerPreviousPaintInvalidationRect = LayoutRect(); | 
| 130 } | 123 } | 
| 131 | 124 | 
| 132 } // namespace blink | 125 } // namespace blink | 
| OLD | NEW | 
|---|