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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static PassOwnPtr<ScrollingCoordinator> create(Page*); | 57 static PassOwnPtr<ScrollingCoordinator> create(Page*); |
58 | 58 |
59 void willBeDestroyed(); | 59 void willBeDestroyed(); |
60 | 60 |
61 // Return whether this scrolling coordinator handles scrolling for the given
frame view. | 61 // Return whether this scrolling coordinator handles scrolling for the given
frame view. |
62 bool coordinatesScrollingForFrameView(FrameView*) const; | 62 bool coordinatesScrollingForFrameView(FrameView*) const; |
63 | 63 |
64 // Called when any frame has done its layout. | 64 // Called when any frame has done its layout. |
65 void notifyLayoutUpdated(); | 65 void notifyLayoutUpdated(); |
66 | 66 |
67 // Should be called after compositing has been updated. | 67 void updateAfterCompositingChangeIfNeeded(); |
68 void updateAfterCompositingChange(); | |
69 | |
70 bool needsToUpdateAfterCompositingChange() const { return m_scrollGestureReg
ionIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); } | |
71 | 68 |
72 void updateHaveWheelEventHandlers(); | 69 void updateHaveWheelEventHandlers(); |
73 void updateHaveScrollEventHandlers(); | 70 void updateHaveScrollEventHandlers(); |
74 | 71 |
75 // Should be called whenever the slow repaint objects counter changes betwee
n zero and one. | 72 // Should be called whenever the slow repaint objects counter changes betwee
n zero and one. |
76 void frameViewHasSlowRepaintObjectsDidChange(FrameView*); | 73 void frameViewHasSlowRepaintObjectsDidChange(FrameView*); |
77 | 74 |
78 // Should be called whenever the set of fixed objects changes. | 75 // Should be called whenever the set of fixed objects changes. |
79 void frameViewFixedObjectsDidChange(FrameView*); | 76 void frameViewFixedObjectsDidChange(FrameView*); |
80 | 77 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 bool isForMainFrame(ScrollableArea*) const; | 122 bool isForMainFrame(ScrollableArea*) const; |
126 | 123 |
127 Page* m_page; | 124 Page* m_page; |
128 | 125 |
129 // Dirty flags used to idenfity what really needs to be computed after compo
siting is updated. | 126 // Dirty flags used to idenfity what really needs to be computed after compo
siting is updated. |
130 bool m_scrollGestureRegionIsDirty; | 127 bool m_scrollGestureRegionIsDirty; |
131 bool m_touchEventTargetRectsAreDirty; | 128 bool m_touchEventTargetRectsAreDirty; |
132 bool m_shouldScrollOnMainThreadDirty; | 129 bool m_shouldScrollOnMainThreadDirty; |
133 | 130 |
134 private: | 131 private: |
| 132 bool shouldUpdateAfterCompositingChange() const { return m_scrollGestureRegi
onIsDirty || m_touchEventTargetRectsAreDirty || frameViewIsDirty(); } |
| 133 |
135 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); | 134 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); |
136 | 135 |
137 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; | 136 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; |
138 | 137 |
139 bool touchHitTestingEnabled() const; | 138 bool touchHitTestingEnabled() const; |
140 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); | 139 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); |
141 void setTouchEventTargetRects(LayerHitTestRects&); | 140 void setTouchEventTargetRects(LayerHitTestRects&); |
142 void computeTouchEventTargetRects(LayerHitTestRects&); | 141 void computeTouchEventTargetRects(LayerHitTestRects&); |
143 | 142 |
144 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation, PassOwnPtr<blink::WebScrollbarLayer>); | 143 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation, PassOwnPtr<blink::WebScrollbarLayer>); |
145 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation); | 144 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation); |
146 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); | 145 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); |
147 | 146 |
148 bool frameViewIsDirty() const; | 147 bool frameViewIsDirty() const; |
149 | 148 |
150 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba
rMap; | 149 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba
rMap; |
151 ScrollbarMap m_horizontalScrollbars; | 150 ScrollbarMap m_horizontalScrollbars; |
152 ScrollbarMap m_verticalScrollbars; | 151 ScrollbarMap m_verticalScrollbars; |
153 HashSet<const RenderLayer*> m_layersWithTouchRects; | 152 HashSet<const RenderLayer*> m_layersWithTouchRects; |
154 bool m_wasFrameScrollable; | 153 bool m_wasFrameScrollable; |
155 | 154 |
156 // This is retained for testing. | 155 // This is retained for testing. |
157 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; | 156 MainThreadScrollingReasons m_lastMainThreadScrollingReasons; |
158 }; | 157 }; |
159 | 158 |
160 } // namespace WebCore | 159 } // namespace WebCore |
161 | 160 |
162 #endif // ScrollingCoordinator_h | 161 #endif // ScrollingCoordinator_h |
OLD | NEW |