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 11 matching lines...) Expand all Loading... |
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 * THE POSSIBILITY OF SUCH DAMAGE. | 23 * THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ScrollingCoordinator_h | 26 #ifndef ScrollingCoordinator_h |
27 #define ScrollingCoordinator_h | 27 #define ScrollingCoordinator_h |
28 | 28 |
29 #include "IntRect.h" | 29 #include "IntRect.h" |
30 #include "LayoutRect.h" | 30 #include "LayoutRect.h" |
31 #include "PlatformWheelEvent.h" | 31 #include "PlatformWheelEvent.h" |
32 #include "RenderObject.h" | |
33 #include "ScrollTypes.h" | 32 #include "ScrollTypes.h" |
34 #include "Timer.h" | 33 #include "Timer.h" |
35 #include <wtf/Forward.h> | 34 #include <wtf/Forward.h> |
36 | 35 |
37 #if ENABLE(THREADED_SCROLLING) | 36 #if ENABLE(THREADED_SCROLLING) |
38 #include <wtf/HashMap.h> | 37 #include <wtf/HashMap.h> |
39 #include <wtf/ThreadSafeRefCounted.h> | 38 #include <wtf/ThreadSafeRefCounted.h> |
40 #include <wtf/Threading.h> | 39 #include <wtf/Threading.h> |
41 #endif | 40 #endif |
42 | 41 |
43 #if PLATFORM(MAC) | 42 #if PLATFORM(MAC) |
44 #include <wtf/RetainPtr.h> | 43 #include <wtf/RetainPtr.h> |
45 #endif | 44 #endif |
46 | 45 |
47 namespace WebCore { | 46 namespace WebCore { |
48 | 47 |
49 typedef unsigned MainThreadScrollingReasons; | 48 typedef unsigned MainThreadScrollingReasons; |
50 typedef uint64_t ScrollingNodeID; | 49 typedef uint64_t ScrollingNodeID; |
51 | 50 |
52 enum ScrollingNodeType { ScrollingNode, FixedNode }; | 51 enum ScrollingNodeType { ScrollingNode, FixedNode }; |
53 | 52 |
54 class Document; | |
55 class Frame; | 53 class Frame; |
56 class FrameView; | 54 class FrameView; |
57 class GraphicsLayer; | 55 class GraphicsLayer; |
58 class Page; | 56 class Page; |
59 class Region; | 57 class Region; |
60 class ScrollableArea; | 58 class ScrollableArea; |
61 class ViewportConstraints; | 59 class ViewportConstraints; |
62 | 60 |
63 #if ENABLE(THREADED_SCROLLING) | 61 #if ENABLE(THREADED_SCROLLING) |
64 class ScrollingTree; | 62 class ScrollingTree; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 MainThreadScrollingReasons mainThreadScrollingReasons() const; | 142 MainThreadScrollingReasons mainThreadScrollingReasons() const; |
145 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } | 143 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } |
146 | 144 |
147 // These virtual functions are currently unique to Chromium's WebLayer appro
ach. Their meaningful | 145 // These virtual functions are currently unique to Chromium's WebLayer appro
ach. Their meaningful |
148 // implementations are in ScrollingCoordinatorChromium. | 146 // implementations are in ScrollingCoordinatorChromium. |
149 virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, Graphics
Layer*) { } | 147 virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, Graphics
Layer*) { } |
150 virtual void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLa
yer*) { } | 148 virtual void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLa
yer*) { } |
151 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLay
er*) { } | 149 virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLay
er*) { } |
152 virtual void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool)
{ } | 150 virtual void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool)
{ } |
153 virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool) { } | 151 virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool) { } |
154 virtual void touchEventTargetRectsDidChange(const Document*) { } | |
155 | |
156 #if ENABLE(TOUCH_EVENT_TRACKING) | |
157 void computeAbsoluteTouchEventTargetRects(const Document*, Vector<IntRect>&)
; | |
158 #endif | |
159 | 152 |
160 static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons); | 153 static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons); |
161 String mainThreadScrollingReasonsAsText() const; | 154 String mainThreadScrollingReasonsAsText() const; |
162 | 155 |
163 protected: | 156 protected: |
164 explicit ScrollingCoordinator(Page*); | 157 explicit ScrollingCoordinator(Page*); |
165 | 158 |
166 Region computeNonFastScrollableRegion(Frame*, const IntPoint& frameLocation)
; | 159 Region computeNonFastScrollableRegion(Frame*, const IntPoint& frameLocation)
; |
167 unsigned computeCurrentWheelEventHandlerCount(); | 160 unsigned computeCurrentWheelEventHandlerCount(); |
168 GraphicsLayer* scrollLayerForFrameView(FrameView*); | 161 GraphicsLayer* scrollLayerForFrameView(FrameView*); |
(...skipping 13 matching lines...) Expand all Loading... |
182 IntPoint m_scheduledUpdateScrollPosition; | 175 IntPoint m_scheduledUpdateScrollPosition; |
183 bool m_scheduledUpdateIsProgrammaticScroll; | 176 bool m_scheduledUpdateIsProgrammaticScroll; |
184 SetOrSyncScrollingLayerPosition m_scheduledScrollingLayerPositionAction; | 177 SetOrSyncScrollingLayerPosition m_scheduledScrollingLayerPositionAction; |
185 | 178 |
186 bool m_forceMainThreadScrollLayerPositionUpdates; | 179 bool m_forceMainThreadScrollLayerPositionUpdates; |
187 }; | 180 }; |
188 | 181 |
189 } // namespace WebCore | 182 } // namespace WebCore |
190 | 183 |
191 #endif // ScrollingCoordinator_h | 184 #endif // ScrollingCoordinator_h |
OLD | NEW |