Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
index 0cc3aa168cc781f4b65e8058ebfa727a2c691ea6..fe31bb28925a3d77f3fa771e98ed977210022d84 100644 |
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
@@ -544,8 +544,11 @@ void Scrollbar::SetEnabled(bool e) { |
enabled_ = e; |
GetTheme().UpdateEnabledState(*this); |
- ScrollbarPart invalid_parts = GetTheme().InvalidateOnEnabledChange(); |
- SetNeedsPaintInvalidation(invalid_parts); |
+ // We can skip thumb/track repaint when hiding an overlay scrollbar, but not |
+ // when showing (since the proportions may have changed while hidden). |
+ bool skipPartsRepaint = IsOverlayScrollbar() && scrollable_area_ && |
+ scrollable_area_->ScrollbarsHidden(); |
+ SetNeedsPaintInvalidation(skipPartsRepaint ? kNoPart : kAllParts); |
bokan
2017/04/25 23:21:17
On the CC side (for Aura anyway) we only need to p
skobes
2017/04/26 01:28:58
I think ideally we would not repurpose the enabled
bokan
2017/04/26 11:51:09
It's an unfortunate quirk of main-thread painting
|
} |
int Scrollbar::ScrollbarThickness() const { |