| 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 #ifndef PaintInvalidationCapableScrollableArea_h | 5 #ifndef PaintInvalidationCapableScrollableArea_h |
| 6 #define PaintInvalidationCapableScrollableArea_h | 6 #define PaintInvalidationCapableScrollableArea_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
| 10 #include "platform/scroll/ScrollableArea.h" | 10 #include "platform/scroll/ScrollableArea.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 PaintInvalidationCapableScrollableArea() | 26 PaintInvalidationCapableScrollableArea() |
| 27 : m_horizontalScrollbarPreviouslyWasOverlay(false), | 27 : m_horizontalScrollbarPreviouslyWasOverlay(false), |
| 28 m_verticalScrollbarPreviouslyWasOverlay(false) {} | 28 m_verticalScrollbarPreviouslyWasOverlay(false) {} |
| 29 | 29 |
| 30 void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation) override; | 30 void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation) override; |
| 31 | 31 |
| 32 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&); | 32 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&); |
| 33 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidatorContext&); | 33 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidatorContext&); |
| 34 | 34 |
| 35 // Should be called when the previous paint invalidation rects are no longer | 35 // Should be called when the previous visual rects are no longer valid. |
| 36 // valid. | 36 void clearPreviousVisualRects(); |
| 37 void clearPreviousPaintInvalidationRects(); | |
| 38 | 37 |
| 39 virtual IntRect scrollCornerAndResizerRect() const { | 38 virtual IntRect scrollCornerAndResizerRect() const { |
| 40 return scrollCornerRect(); | 39 return scrollCornerRect(); |
| 41 } | 40 } |
| 42 | 41 |
| 43 LayoutRect visualRectForScrollbarParts() const override; | 42 LayoutRect visualRectForScrollbarParts() const override; |
| 44 | 43 |
| 45 private: | 44 private: |
| 46 virtual LayoutScrollbarPart* scrollCorner() const = 0; | 45 virtual LayoutScrollbarPart* scrollCorner() const = 0; |
| 47 virtual LayoutScrollbarPart* resizer() const = 0; | 46 virtual LayoutScrollbarPart* resizer() const = 0; |
| 48 | 47 |
| 49 void scrollControlWasSetNeedsPaintInvalidation() override; | 48 void scrollControlWasSetNeedsPaintInvalidation() override; |
| 50 | 49 |
| 51 bool m_horizontalScrollbarPreviouslyWasOverlay; | 50 bool m_horizontalScrollbarPreviouslyWasOverlay; |
| 52 bool m_verticalScrollbarPreviouslyWasOverlay; | 51 bool m_verticalScrollbarPreviouslyWasOverlay; |
| 53 LayoutRect m_horizontalScrollbarPreviousPaintInvalidationRect; | 52 LayoutRect m_horizontalScrollbarPreviousVisualRect; |
| 54 LayoutRect m_verticalScrollbarPreviousPaintInvalidationRect; | 53 LayoutRect m_verticalScrollbarPreviousVisualRect; |
| 55 LayoutRect m_scrollCornerAndResizerPreviousPaintInvalidationRect; | 54 LayoutRect m_scrollCornerAndResizerPreviousVisualRect; |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 } // namespace blink | 57 } // namespace blink |
| 59 | 58 |
| 60 #endif // PaintInvalidationCapableScrollableArea_h | 59 #endif // PaintInvalidationCapableScrollableArea_h |
| OLD | NEW |