OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Should be called after compositing has been updated. | 66 // Should be called after compositing has been updated. |
67 void updateAfterCompositingChange(); | 67 void updateAfterCompositingChange(); |
68 | 68 |
69 bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureReg
ionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); } | 69 bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureReg
ionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); } |
70 | 70 |
71 // Should be called whenever a wheel event handler is added or removed in th
e | 71 // Should be called whenever a wheel event handler is added or removed in th
e |
72 // frame view's underlying document. | 72 // frame view's underlying document. |
73 void frameViewWheelEventHandlerCountChanged(FrameView*); | 73 void frameViewWheelEventHandlerCountChanged(FrameView*); |
74 | 74 |
| 75 // Should be called whenever a scroll event handler is added or removed in t
he |
| 76 // frame view's underlying document. |
| 77 void frameViewScrollEventHandlerCountChanged(FrameView*); |
| 78 |
75 // Should be called whenever the slow repaint objects counter changes betwee
n zero and one. | 79 // Should be called whenever the slow repaint objects counter changes betwee
n zero and one. |
76 void frameViewHasSlowRepaintObjectsDidChange(FrameView*); | 80 void frameViewHasSlowRepaintObjectsDidChange(FrameView*); |
77 | 81 |
78 // Should be called whenever the set of fixed objects changes. | 82 // Should be called whenever the set of fixed objects changes. |
79 void frameViewFixedObjectsDidChange(FrameView*); | 83 void frameViewFixedObjectsDidChange(FrameView*); |
80 | 84 |
81 // Should be called whenever the root layer for the given frame view changes
. | 85 // Should be called whenever the root layer for the given frame view changes
. |
82 void frameViewRootLayerDidChange(FrameView*); | 86 void frameViewRootLayerDidChange(FrameView*); |
83 | 87 |
84 #if OS(MACOSX) | 88 #if OS(MACOSX) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 121 |
118 // For testing purposes only. This ScrollingCoordinator is reused between la
yout test, and must be reset | 122 // For testing purposes only. This ScrollingCoordinator is reused between la
yout test, and must be reset |
119 // for the results to be valid. | 123 // for the results to be valid. |
120 void reset(); | 124 void reset(); |
121 | 125 |
122 protected: | 126 protected: |
123 explicit ScrollingCoordinator(Page*); | 127 explicit ScrollingCoordinator(Page*); |
124 | 128 |
125 bool isForMainFrame(ScrollableArea*) const; | 129 bool isForMainFrame(ScrollableArea*) const; |
126 | 130 |
127 unsigned computeCurrentWheelEventHandlerCount(); | |
128 GraphicsLayer* scrollLayerForFrameView(FrameView*); | 131 GraphicsLayer* scrollLayerForFrameView(FrameView*); |
129 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*); | 132 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*); |
130 | 133 |
131 Page* m_page; | 134 Page* m_page; |
132 | 135 |
133 // Dirty flags used to idenfity what really needs to be computed after compo
siting is updated. | 136 // Dirty flags used to idenfity what really needs to be computed after compo
siting is updated. |
134 bool m_scrollGestureRegionIsDirty; | 137 bool m_scrollGestureRegionIsDirty; |
135 bool m_touchEventTargetRectsAreDirty; | 138 bool m_touchEventTargetRectsAreDirty; |
136 bool m_shouldScrollOnMainThreadDirty; | 139 bool m_shouldScrollOnMainThreadDirty; |
137 | 140 |
138 private: | 141 private: |
139 void recomputeWheelEventHandlerCountForFrameView(FrameView*); | 142 void updateWheelEventHandlerCountForFrameView(FrameView*); |
| 143 void updateScrollEventHandlerCountForFrameView(FrameView*); |
140 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); | 144 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); |
141 | 145 |
142 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; | 146 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; |
143 | 147 |
144 bool touchHitTestingEnabled() const; | 148 bool touchHitTestingEnabled() const; |
145 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); | 149 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); |
146 void setTouchEventTargetRects(const LayerHitTestRects&); | 150 void setTouchEventTargetRects(const LayerHitTestRects&); |
147 void computeTouchEventTargetRects(LayerHitTestRects&); | 151 void computeTouchEventTargetRects(LayerHitTestRects&); |
148 void setWheelEventHandlerCount(unsigned); | 152 void setWheelEventHandlerCount(unsigned); |
| 153 void setScrollEventHandlerCount(unsigned); |
149 | 154 |
150 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation, PassOwnPtr<blink::WebScrollbarLayer>); | 155 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation, PassOwnPtr<blink::WebScrollbarLayer>); |
151 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation); | 156 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation); |
152 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); | 157 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); |
153 | 158 |
154 bool frameViewIsDirty() const; | 159 bool frameViewIsDirty() const; |
155 | 160 |
156 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba
rMap; | 161 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba
rMap; |
157 ScrollbarMap m_horizontalScrollbars; | 162 ScrollbarMap m_horizontalScrollbars; |
158 ScrollbarMap m_verticalScrollbars; | 163 ScrollbarMap m_verticalScrollbars; |
159 HashSet<const RenderLayer*> m_layersWithTouchRects; | 164 HashSet<const RenderLayer*> m_layersWithTouchRects; |
160 bool m_wasFrameScrollable; | 165 bool m_wasFrameScrollable; |
161 | 166 |
162 // This is retained for testing. | 167 // This is retained for testing. |
163 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; | 168 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; |
164 }; | 169 }; |
165 | 170 |
166 } // namespace WebCore | 171 } // namespace WebCore |
167 | 172 |
168 #endif // ScrollingCoordinator_h | 173 #endif // ScrollingCoordinator_h |
OLD | NEW |