Chromium Code Reviews| 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..237631aee0ab2afe09b667386c5075465b782936 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 is painted in a separate layer. |
|
skobes
2015/12/28 17:48:39
Technically the thumb is never a separate layer.
jbroman
2015/12/29 16:45:14
reworded to "...unaware of whether the thumb can b
|
| + // |
| + // 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; |
| }; |