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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.h

Issue 1558493002: Reland: Make ScrollbarThemeAura selectively invalidate scrollbar parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ScrollableAreaTest.InvalidatesCompositedScrollbarsIfPartsNeedRepaint for Oilpan 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scroll/Scrollbar.h
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.h b/third_party/WebKit/Source/platform/scroll/Scrollbar.h
index 0cf202f7f0ed9c1afe03aeacaca0b12e4176bfa1..d7f430c1481d46b128e2bd1ea79439dd8d5a9a1f 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.h
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.h
@@ -94,7 +94,15 @@ public:
void setEnabled(bool) override;
// Called by the ScrollableArea when the scroll offset changes.
- void offsetDidChange();
+ //
+ // Will invalidate the scrollbar if either the track or the thumb is
+ // invalidated. The caller is responsible for issuing paint invalidations
+ // when only the thumb position changes, as the scrollbar is unaware of
+ // whether the thumb can be moved without repainting.
+ //
+ // Returns true if the scrollbar's offset was actually updated, so that the
+ // caller can issue additional invalidations as needed.
+ bool offsetDidChange();
void disconnectFromScrollableArea();
ScrollableArea* scrollableArea() const { return m_scrollableArea; }
@@ -141,6 +149,7 @@ public:
float elasticOverscroll() const override { return m_elasticOverscroll; }
void setElasticOverscroll(float elasticOverscroll) override { m_elasticOverscroll = elasticOverscroll; }
+ // Use setNeedsPaintInvalidation to cause scrollbar parts to repaint.
bool trackNeedsRepaint() const { return m_trackNeedsRepaint; }
void setTrackNeedsRepaint(bool trackNeedsRepaint) { m_trackNeedsRepaint = trackNeedsRepaint; }
bool thumbNeedsRepaint() const { return m_thumbNeedsRepaint; }
@@ -154,7 +163,9 @@ public:
// TODO(chrishtr): fix this.
IntRect visualRect() const override { return IntRect(); }
- void setNeedsPaintInvalidation();
+ // Marks the specified parts of the scrollbar as needing paint invalidation.
+ // Uses the associated ScrollableArea to cause invalidation.
+ void setNeedsPaintInvalidation(ScrollbarPart = AllParts);
// Promptly unregister from the theme manager + run finalizers of derived Scrollbars.
EAGERLY_FINALIZE();
@@ -166,7 +177,6 @@ public:
protected:
Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
- void updateThumb();
void autoscrollTimerFired(Timer<Scrollbar>*);
void startTimerIfNeeded(double delay);
@@ -207,9 +217,6 @@ private:
float scrollableAreaCurrentPos() const;
- void updateThumbPosition();
- void updateThumbProportion();
-
bool m_trackNeedsRepaint;
bool m_thumbNeedsRepaint;
};

Powered by Google App Engine
This is Rietveld 408576698