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

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

Issue 1456953003: Revert of 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
68 ScrollbarOverlayStyle scrollbarOverlayStyle() const override; 71 ScrollbarOverlayStyle scrollbarOverlayStyle() const override;
69 void getTickmarks(Vector<IntRect>&) const override; 72 void getTickmarks(Vector<IntRect>&) const override;
70 bool isScrollableAreaActive() const override; 73 bool isScrollableAreaActive() const override;
71 74
72 IntPoint convertFromContainingWindow(const IntPoint& windowPoint) const over ride { return Widget::convertFromContainingWindow(windowPoint); } 75 IntPoint convertFromContainingWindow(const IntPoint& windowPoint) const over ride { return Widget::convertFromContainingWindow(windowPoint); }
73 76
74 bool isCustomScrollbar() const override { return false; } 77 bool isCustomScrollbar() const override { return false; }
75 ScrollbarOrientation orientation() const override { return m_orientation; } 78 ScrollbarOrientation orientation() const override { return m_orientation; }
76 bool isLeftSideVerticalScrollbar() const override; 79 bool isLeftSideVerticalScrollbar() const override;
77 80
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void mouseMoved(const PlatformMouseEvent&); 122 void mouseMoved(const PlatformMouseEvent&);
120 void mouseEntered(); 123 void mouseEntered();
121 void mouseExited(); 124 void mouseExited();
122 125
123 // Used by some platform scrollbars to know when they've been released from capture. 126 // Used by some platform scrollbars to know when they've been released from capture.
124 void mouseUp(const PlatformMouseEvent&); 127 void mouseUp(const PlatformMouseEvent&);
125 void mouseDown(const PlatformMouseEvent&); 128 void mouseDown(const PlatformMouseEvent&);
126 129
127 ScrollbarTheme* theme() const { return m_theme; } 130 ScrollbarTheme* theme() const { return m_theme; }
128 131
132 bool suppressInvalidation() const { return m_suppressInvalidation; }
133 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
134
129 IntRect convertToContainingView(const IntRect&) const override; 135 IntRect convertToContainingView(const IntRect&) const override;
130 IntRect convertFromContainingView(const IntRect&) const override; 136 IntRect convertFromContainingView(const IntRect&) const override;
131 137
132 IntPoint convertToContainingView(const IntPoint&) const override; 138 IntPoint convertToContainingView(const IntPoint&) const override;
133 IntPoint convertFromContainingView(const IntPoint&) const override; 139 IntPoint convertFromContainingView(const IntPoint&) const override;
134 140
135 void moveThumb(int pos, bool draggingDocument = false); 141 void moveThumb(int pos, bool draggingDocument = false);
136 142
137 bool isAlphaLocked() const override { return m_isAlphaLocked; } 143 bool isAlphaLocked() const override { return m_isAlphaLocked; }
138 void setIsAlphaLocked(bool flag) override { m_isAlphaLocked = flag; } 144 void setIsAlphaLocked(bool flag) override { m_isAlphaLocked = flag; }
139 145
140 float elasticOverscroll() const override { return m_elasticOverscroll; } 146 float elasticOverscroll() const override { return m_elasticOverscroll; }
141 void setElasticOverscroll(float elasticOverscroll) override { m_elasticOvers croll = elasticOverscroll; } 147 void setElasticOverscroll(float elasticOverscroll) override { m_elasticOvers croll = elasticOverscroll; }
142 148
143 bool overlapsResizer() const { return m_overlapsResizer; } 149 bool overlapsResizer() const { return m_overlapsResizer; }
144 void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlaps Resizer; } 150 void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlaps Resizer; }
145 151
146 DisplayItemClient displayItemClient() const override { return toDisplayItemC lient(this); } 152 DisplayItemClient displayItemClient() const override { return toDisplayItemC lient(this); }
147 String debugName() const override { return m_orientation == HorizontalScroll bar ? "HorizontalScrollbar" : "VerticalScrollbar"; } 153 String debugName() const override { return m_orientation == HorizontalScroll bar ? "HorizontalScrollbar" : "VerticalScrollbar"; }
148 154
149 void setNeedsPaintInvalidation();
150
151 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars. 155 // Promptly unregister from the theme manager + run finalizers of derived Sc rollbars.
152 EAGERLY_FINALIZE(); 156 EAGERLY_FINALIZE();
153 #if ENABLE(OILPAN) 157 #if ENABLE(OILPAN)
154 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); 158 DECLARE_EAGER_FINALIZATION_OPERATOR_NEW();
155 #endif 159 #endif
156 DECLARE_VIRTUAL_TRACE(); 160 DECLARE_VIRTUAL_TRACE();
157 161
158 protected: 162 protected:
159 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol lbarTheme* = 0); 163 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol lbarTheme* = 0);
160 164
(...skipping 23 matching lines...) Expand all
184 int m_pressedPos; 188 int m_pressedPos;
185 float m_scrollPos; 189 float m_scrollPos;
186 bool m_draggingDocument; 190 bool m_draggingDocument;
187 int m_documentDragPos; 191 int m_documentDragPos;
188 192
189 bool m_enabled; 193 bool m_enabled;
190 194
191 Timer<Scrollbar> m_scrollTimer; 195 Timer<Scrollbar> m_scrollTimer;
192 bool m_overlapsResizer; 196 bool m_overlapsResizer;
193 197
198 bool m_suppressInvalidation;
199
194 bool m_isAlphaLocked; 200 bool m_isAlphaLocked;
195 201
196 float m_elasticOverscroll; 202 float m_elasticOverscroll;
197 203
198 private: 204 private:
199 bool isScrollbar() const override { return true; } 205 bool isScrollbar() const override { return true; }
200 206
201 void invalidate() override { setNeedsPaintInvalidation(); }
202 void invalidateRect(const IntRect&) override { setNeedsPaintInvalidation(); }
203
204 float scrollableAreaCurrentPos() const; 207 float scrollableAreaCurrentPos() const;
205 }; 208 };
206 209
207 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar()); 210 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr ollbar());
208 211
209 } // namespace blink 212 } // namespace blink
210 213
211 #endif // Scrollbar_h 214 #endif // Scrollbar_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698