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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } | 91 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } |
92 | 92 |
93 void willDestroyScrollableArea(ScrollableArea*); | 93 void willDestroyScrollableArea(ScrollableArea*); |
94 // Returns true if the coordinator handled this change. | 94 // Returns true if the coordinator handled this change. |
95 bool scrollableAreaScrollLayerDidChange(ScrollableArea*); | 95 bool scrollableAreaScrollLayerDidChange(ScrollableArea*); |
96 void scrollableAreaScrollbarLayerDidChange(ScrollableArea*, ScrollbarOrienta
tion); | 96 void scrollableAreaScrollbarLayerDidChange(ScrollableArea*, ScrollbarOrienta
tion); |
97 void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool); | 97 void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool); |
98 void updateLayerPositionConstraint(RenderLayer*); | 98 void updateLayerPositionConstraint(RenderLayer*); |
99 void touchEventTargetRectsDidChange(const Document*); | 99 void touchEventTargetRectsDidChange(const Document*); |
100 | 100 |
101 void computeAbsoluteTouchEventTargetRects(const Document*, Vector<IntRect>&)
; | |
102 | |
103 static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons); | 101 static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons); |
104 String mainThreadScrollingReasonsAsText() const; | 102 String mainThreadScrollingReasonsAsText() const; |
105 Region computeShouldHandleScrollGestureOnMainThreadRegion(const Frame*, cons
t IntPoint& frameLocation) const; | 103 Region computeShouldHandleScrollGestureOnMainThreadRegion(const Frame*, cons
t IntPoint& frameLocation) const; |
106 | 104 |
| 105 class TouchEventTargetRectsObserver { |
| 106 public: |
| 107 virtual void touchEventTargetRectsChanged(const LayerHitTestRects&) = 0; |
| 108 }; |
| 109 |
| 110 void addTouchEventTargetRectsObserver(TouchEventTargetRectsObserver*); |
| 111 void removeTouchEventTargetRectsObserver(TouchEventTargetRectsObserver*); |
| 112 |
107 protected: | 113 protected: |
108 explicit ScrollingCoordinator(Page*); | 114 explicit ScrollingCoordinator(Page*); |
109 | 115 |
110 static GraphicsLayer* scrollLayerForScrollableArea(ScrollableArea*); | 116 static GraphicsLayer* scrollLayerForScrollableArea(ScrollableArea*); |
111 static GraphicsLayer* horizontalScrollbarLayerForScrollableArea(ScrollableAr
ea*); | 117 static GraphicsLayer* horizontalScrollbarLayerForScrollableArea(ScrollableAr
ea*); |
112 static GraphicsLayer* verticalScrollbarLayerForScrollableArea(ScrollableArea
*); | 118 static GraphicsLayer* verticalScrollbarLayerForScrollableArea(ScrollableArea
*); |
113 bool isForMainFrame(ScrollableArea*) const; | 119 bool isForMainFrame(ScrollableArea*) const; |
114 | 120 |
115 unsigned computeCurrentWheelEventHandlerCount(); | 121 unsigned computeCurrentWheelEventHandlerCount(); |
116 GraphicsLayer* scrollLayerForFrameView(FrameView*); | 122 GraphicsLayer* scrollLayerForFrameView(FrameView*); |
117 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*); | 123 GraphicsLayer* counterScrollingLayerForFrameView(FrameView*); |
118 | 124 |
119 Page* m_page; | 125 Page* m_page; |
120 | 126 |
121 private: | 127 private: |
122 void recomputeWheelEventHandlerCountForFrameView(FrameView*); | 128 void recomputeWheelEventHandlerCountForFrameView(FrameView*); |
123 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); | 129 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); |
124 | 130 |
125 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; | 131 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; |
126 void updateShouldUpdateScrollLayerPositionOnMainThread(); | 132 void updateShouldUpdateScrollLayerPositionOnMainThread(); |
127 | 133 |
128 static WebKit::WebLayer* scrollingWebLayerForScrollableArea(ScrollableArea*)
; | 134 static WebKit::WebLayer* scrollingWebLayerForScrollableArea(ScrollableArea*)
; |
129 | 135 |
130 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); | 136 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); |
131 void setTouchEventTargetRects(const Vector<IntRect>&); | 137 void setTouchEventTargetRects(const LayerHitTestRects&); |
| 138 void computeTouchEventTargetRects(LayerHitTestRects&); |
132 void setWheelEventHandlerCount(unsigned); | 139 void setWheelEventHandlerCount(unsigned); |
133 | 140 |
134 WebKit::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation, PassOwnPtr<WebKit::WebScrollbarLayer>); | 141 WebKit::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation, PassOwnPtr<WebKit::WebScrollbarLayer>); |
135 WebKit::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation); | 142 WebKit::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation); |
136 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); | 143 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); |
137 | 144 |
138 typedef HashMap<ScrollableArea*, OwnPtr<WebKit::WebScrollbarLayer> > Scrollb
arMap; | 145 typedef HashMap<ScrollableArea*, OwnPtr<WebKit::WebScrollbarLayer> > Scrollb
arMap; |
139 ScrollbarMap m_horizontalScrollbars; | 146 ScrollbarMap m_horizontalScrollbars; |
140 ScrollbarMap m_verticalScrollbars; | 147 ScrollbarMap m_verticalScrollbars; |
141 | 148 |
| 149 HashSet<TouchEventTargetRectsObserver*> m_touchEventTargetRectsObservers; |
142 }; | 150 }; |
143 | 151 |
144 } // namespace WebCore | 152 } // namespace WebCore |
145 | 153 |
146 #endif // ScrollingCoordinator_h | 154 #endif // ScrollingCoordinator_h |
OLD | NEW |