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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.h

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 int height() const override { return Widget::height(); } 58 int height() const override { return Widget::height(); }
59 IntSize size() const override { return Widget::size(); } 59 IntSize size() const override { return Widget::size(); }
60 IntPoint location() const override { return Widget::location(); } 60 IntPoint location() const override { return Widget::location(); }
61 61
62 Widget* parent() const override { return Widget::parent(); } 62 Widget* parent() const override { return Widget::parent(); }
63 Widget* root() const override { return Widget::root(); } 63 Widget* root() const override { return Widget::root(); }
64 64
65 void setFrameRect(const IntRect&) override; 65 void setFrameRect(const IntRect&) override;
66 IntRect frameRect() const override { return Widget::frameRect(); } 66 IntRect frameRect() const override { return Widget::frameRect(); }
67 67
68 void invalidate() override { Widget::invalidate(); }
69 void invalidateRect(const IntRect&) override;
70
71 ScrollbarOverlayStyle scrollbarOverlayStyle() const override; 68 ScrollbarOverlayStyle scrollbarOverlayStyle() const override;
72 void getTickmarks(Vector<IntRect>&) const override; 69 void getTickmarks(Vector<IntRect>&) const override;
73 bool isScrollableAreaActive() const override; 70 bool isScrollableAreaActive() const override;
74 71
75 IntPoint convertFromContainingWindow(const IntPoint& windowPoint) const over ride { return Widget::convertFromContainingWindow(windowPoint); } 72 IntPoint convertFromContainingWindow(const IntPoint& windowPoint) const over ride { return Widget::convertFromContainingWindow(windowPoint); }
76 73
77 bool isCustomScrollbar() const override { return false; } 74 bool isCustomScrollbar() const override { return false; }
78 ScrollbarOrientation orientation() const override { return m_orientation; } 75 ScrollbarOrientation orientation() const override { return m_orientation; }
79 bool isLeftSideVerticalScrollbar() const override; 76 bool isLeftSideVerticalScrollbar() const override;
80 77
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void mouseMoved(const PlatformMouseEvent&); 119 void mouseMoved(const PlatformMouseEvent&);
123 void mouseEntered(); 120 void mouseEntered();
124 void mouseExited(); 121 void mouseExited();
125 122
126 // Used by some platform scrollbars to know when they've been released from capture. 123 // Used by some platform scrollbars to know when they've been released from capture.
127 void mouseUp(const PlatformMouseEvent&); 124 void mouseUp(const PlatformMouseEvent&);
128 void mouseDown(const PlatformMouseEvent&); 125 void mouseDown(const PlatformMouseEvent&);
129 126
130 ScrollbarTheme* theme() const { return m_theme; } 127 ScrollbarTheme* theme() const { return m_theme; }
131 128
132 bool suppressInvalidation() const { return m_suppressInvalidation; }
133 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
134
135 IntRect convertToContainingView(const IntRect&) const override; 129 IntRect convertToContainingView(const IntRect&) const override;
136 IntRect convertFromContainingView(const IntRect&) const override; 130 IntRect convertFromContainingView(const IntRect&) const override;
137 131
138 IntPoint convertToContainingView(const IntPoint&) const override; 132 IntPoint convertToContainingView(const IntPoint&) const override;
139 IntPoint convertFromContainingView(const IntPoint&) const override; 133 IntPoint convertFromContainingView(const IntPoint&) const override;
140 134
141 void moveThumb(int pos, bool draggingDocument = false); 135 void moveThumb(int pos, bool draggingDocument = false);
142 136
143 bool isAlphaLocked() const override { return m_isAlphaLocked; } 137 bool isAlphaLocked() const override { return m_isAlphaLocked; }
144 void setIsAlphaLocked(bool flag) override { m_isAlphaLocked = flag; } 138 void setIsAlphaLocked(bool flag) override { m_isAlphaLocked = flag; }
145 139
146 float elasticOverscroll() const override { return m_elasticOverscroll; } 140 float elasticOverscroll() const override { return m_elasticOverscroll; }
147 void setElasticOverscroll(float elasticOverscroll) override { m_elasticOvers croll = elasticOverscroll; } 141 void setElasticOverscroll(float elasticOverscroll) override { m_elasticOvers croll = elasticOverscroll; }
148 142
149 bool overlapsResizer() const { return m_overlapsResizer; } 143 bool overlapsResizer() const { return m_overlapsResizer; }
150 void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlaps Resizer; } 144 void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlaps Resizer; }
151 145
152 DisplayItemClient displayItemClient() const override { return toDisplayItemC lient(this); } 146 DisplayItemClient displayItemClient() const override { return toDisplayItemC lient(this); }
153 String debugName() const override { return m_orientation == HorizontalScroll bar ? "HorizontalScrollbar" : "VerticalScrollbar"; } 147 String debugName() const override { return m_orientation == HorizontalScroll bar ? "HorizontalScrollbar" : "VerticalScrollbar"; }
154 148
149 void setNeedsPaintInvalidation();
150
155 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars. 151 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars.
156 EAGERLY_FINALIZE(); 152 EAGERLY_FINALIZE();
157 #if ENABLE(OILPAN) 153 #if ENABLE(OILPAN)
158 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); 154 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW();
159 #endif 155 #endif
160 DECLARE_VIRTUAL_TRACE(); 156 DECLARE_VIRTUAL_TRACE();
161 157
162 protected: 158 protected:
163 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol lbarTheme* = 0); 159 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol lbarTheme* = 0);
164 160
(...skipping 23 matching lines...) Expand all
188 int m_pressedPos; 184 int m_pressedPos;
189 float m_scrollPos; 185 float m_scrollPos;
190 bool m_draggingDocument; 186 bool m_draggingDocument;
191 int m_documentDragPos; 187 int m_documentDragPos;
192 188
193 bool m_enabled; 189 bool m_enabled;
194 190
195 Timer<Scrollbar> m_scrollTimer; 191 Timer<Scrollbar> m_scrollTimer;
196 bool m_overlapsResizer; 192 bool m_overlapsResizer;
197 193
198 bool m_suppressInvalidation;
199
200 bool m_isAlphaLocked; 194 bool m_isAlphaLocked;
201 195
202 float m_elasticOverscroll; 196 float m_elasticOverscroll;
203 197
204 private: 198 private:
205 bool isScrollbar() const override { return true; } 199 bool isScrollbar() const override { return true; }
206 200
201 void invalidate() override { setNeedsPaintInvalidation(); }
202 void invalidateRect(const IntRect&) override { setNeedsPaintInvalidation(); }
203
207 float scrollableAreaCurrentPos() const; 204 float scrollableAreaCurrentPos() const;
208 }; 205 };
209 206
210 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar()); 207 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar());
211 208
212 } // namespace blink 209 } // namespace blink
213 210
214 #endif // Scrollbar_h 211 #endif // Scrollbar_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698