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

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

Issue 1511143002: Reland of Fix several corner case issues of scrollbar paint invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 #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 19
20 // Base class of FrameView and PaintLayerScrollableArea to share paint invalidat ion code. 20 // Base class of FrameView and PaintLayerScrollableArea to share paint invalidat ion code.
21 // TODO(wangxianzhu): Combine this into PaintLayerScrollableArea when root-layer -scrolls launches. 21 // TODO(wangxianzhu): Combine this into PaintLayerScrollableArea when root-layer -scrolls launches.
22 class CORE_EXPORT PaintInvalidationCapableScrollableArea : public ScrollableArea { 22 class CORE_EXPORT PaintInvalidationCapableScrollableArea : public ScrollableArea {
23 public: 23 public:
24 PaintInvalidationCapableScrollableArea()
25 : m_horizontalScrollbarPreviouslyWasOverlay(false)
26 , m_verticalScrollbarPreviouslyWasOverlay(false) { }
27
24 void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; 28 void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override;
25 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&, const LayoutBoxModelObject& paintInvalidationContainer); 29 void invalidatePaintOfScrollControlsIfNeeded(const PaintInvalidationState&, const LayoutBoxModelObject& paintInvalidationContainer);
26 30
31 // Should be called when the previous paint invalidation rects are no longer valid.
32 void clearPreviousPaintInvalidationRects();
33
27 private: 34 private:
28 virtual LayoutBox& boxForScrollControlPaintInvalidation() const = 0; 35 virtual LayoutBox& boxForScrollControlPaintInvalidation() const = 0;
29 virtual LayoutScrollbarPart* scrollCorner() const = 0; 36 virtual LayoutScrollbarPart* scrollCorner() const = 0;
30 virtual LayoutScrollbarPart* resizer() const = 0; 37 virtual LayoutScrollbarPart* resizer() const = 0;
31 38
39 bool m_horizontalScrollbarPreviouslyWasOverlay;
40 bool m_verticalScrollbarPreviouslyWasOverlay;
32 LayoutRect m_horizontalScrollbarPreviousPaintInvalidationRect; 41 LayoutRect m_horizontalScrollbarPreviousPaintInvalidationRect;
33 LayoutRect m_verticalScrollbarPreviousPaintInvalidationRect; 42 LayoutRect m_verticalScrollbarPreviousPaintInvalidationRect;
34 LayoutRect m_scrollCornerPreviousPaintInvalidationRect; 43 LayoutRect m_scrollCornerPreviousPaintInvalidationRect;
35 }; 44 };
36 45
37 } // namespace blink 46 } // namespace blink
38 47
39 #endif // PaintInvalidationCapableScrollableArea_h 48 #endif // PaintInvalidationCapableScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698