| 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" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class LayoutBox; | 14 class LayoutBox; |
| 15 class LayoutBoxModelObject; | 15 class LayoutBoxModelObject; |
| 16 class LayoutScrollbarPart; | 16 class LayoutScrollbarPart; |
| 17 class PaintInvalidationContainer; | 17 class PaintInvalidationContainer; |
| 18 class PaintInvalidationState; | 18 class PaintInvalidationState; |
| 19 struct PaintInvalidatorContext; |
| 19 | 20 |
| 20 // Base class of FrameView and PaintLayerScrollableArea to share paint invalidat
ion code. | 21 // Base class of FrameView and PaintLayerScrollableArea to share paint invalidat
ion code. |
| 21 // TODO(wangxianzhu): Combine this into PaintLayerScrollableArea when root-layer
-scrolls launches. | 22 // TODO(wangxianzhu): Combine this into PaintLayerScrollableArea when root-layer
-scrolls launches. |
| 22 class CORE_EXPORT PaintInvalidationCapableScrollableArea : public ScrollableArea
{ | 23 class CORE_EXPORT PaintInvalidationCapableScrollableArea : public ScrollableArea
{ |
| 23 public: | 24 public: |
| 24 PaintInvalidationCapableScrollableArea() | 25 PaintInvalidationCapableScrollableArea() |
| 25 : m_horizontalScrollbarPreviouslyWasOverlay(false) | 26 : m_horizontalScrollbarPreviouslyWasOverlay(false) |
| 26 , m_verticalScrollbarPreviouslyWasOverlay(false) { } | 27 , m_verticalScrollbarPreviouslyWasOverlay(false) { } |
| 27 | 28 |
| 28 void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation) override; | 29 void willRemoveScrollbar(Scrollbar&, ScrollbarOrientation) override; |
| 29 | 30 |
| 30 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&); | 31 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&); |
| 32 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidatorContext&)
; |
| 31 | 33 |
| 32 // Should be called when the previous paint invalidation rects are no longer
valid. | 34 // Should be called when the previous paint invalidation rects are no longer
valid. |
| 33 void clearPreviousPaintInvalidationRects(); | 35 void clearPreviousPaintInvalidationRects(); |
| 34 | 36 |
| 35 virtual IntRect scrollCornerAndResizerRect() const { return scrollCornerRect
(); } | 37 virtual IntRect scrollCornerAndResizerRect() const { return scrollCornerRect
(); } |
| 36 | 38 |
| 37 LayoutRect visualRectForScrollbarParts() const override; | 39 LayoutRect visualRectForScrollbarParts() const override; |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 virtual LayoutScrollbarPart* scrollCorner() const = 0; | 42 virtual LayoutScrollbarPart* scrollCorner() const = 0; |
| 41 virtual LayoutScrollbarPart* resizer() const = 0; | 43 virtual LayoutScrollbarPart* resizer() const = 0; |
| 42 | 44 |
| 43 void scrollControlWasSetNeedsPaintInvalidation() override; | 45 void scrollControlWasSetNeedsPaintInvalidation() override; |
| 44 | 46 |
| 45 bool m_horizontalScrollbarPreviouslyWasOverlay; | 47 bool m_horizontalScrollbarPreviouslyWasOverlay; |
| 46 bool m_verticalScrollbarPreviouslyWasOverlay; | 48 bool m_verticalScrollbarPreviouslyWasOverlay; |
| 47 LayoutRect m_horizontalScrollbarPreviousPaintInvalidationRect; | 49 LayoutRect m_horizontalScrollbarPreviousPaintInvalidationRect; |
| 48 LayoutRect m_verticalScrollbarPreviousPaintInvalidationRect; | 50 LayoutRect m_verticalScrollbarPreviousPaintInvalidationRect; |
| 49 LayoutRect m_scrollCornerAndResizerPreviousPaintInvalidationRect; | 51 LayoutRect m_scrollCornerAndResizerPreviousPaintInvalidationRect; |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 } // namespace blink | 54 } // namespace blink |
| 53 | 55 |
| 54 #endif // PaintInvalidationCapableScrollableArea_h | 56 #endif // PaintInvalidationCapableScrollableArea_h |
| OLD | NEW |