OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // event must be sent again to the WebCore event handler. | 72 // event must be sent again to the WebCore event handler. |
73 EventResult tryToHandleWheelEvent(const PlatformWheelEvent&); | 73 EventResult tryToHandleWheelEvent(const PlatformWheelEvent&); |
74 bool hasWheelEventHandlers() const { return m_hasWheelEventHandlers; } | 74 bool hasWheelEventHandlers() const { return m_hasWheelEventHandlers; } |
75 | 75 |
76 // Can be called from any thread. Will update the back forward state of the
page, used for rubber-banding. | 76 // Can be called from any thread. Will update the back forward state of the
page, used for rubber-banding. |
77 void updateBackForwardState(bool canGoBack, bool canGoForward); | 77 void updateBackForwardState(bool canGoBack, bool canGoForward); |
78 | 78 |
79 // Must be called from the scrolling thread. Handles the wheel event. | 79 // Must be called from the scrolling thread. Handles the wheel event. |
80 void handleWheelEvent(const PlatformWheelEvent&); | 80 void handleWheelEvent(const PlatformWheelEvent&); |
81 | 81 |
82 void setMainFrameIsRubberBanding(bool); | |
83 bool isRubberBandInProgress(); | |
84 | |
85 void invalidate(); | 82 void invalidate(); |
86 void commitNewTreeState(PassOwnPtr<ScrollingStateTree>); | 83 void commitNewTreeState(PassOwnPtr<ScrollingStateTree>); |
87 | 84 |
88 void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight); | 85 void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight); |
89 | 86 |
90 void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSync
ScrollingLayerPosition = SyncScrollingLayerPosition); | 87 void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSync
ScrollingLayerPosition = SyncScrollingLayerPosition); |
91 IntPoint mainFrameScrollPosition(); | 88 IntPoint mainFrameScrollPosition(); |
92 | 89 |
93 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) | 90 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) |
94 void handleWheelEventPhase(PlatformWheelEventPhase); | 91 void handleWheelEventPhase(PlatformWheelEventPhase); |
95 #endif | 92 #endif |
96 | 93 |
97 bool canGoBack(); | 94 bool canGoBack(); |
98 bool canGoForward(); | 95 bool canGoForward(); |
99 | 96 |
100 bool willWheelEventStartSwipeGesture(const PlatformWheelEvent&); | 97 bool willWheelEventStartSwipeGesture(const PlatformWheelEvent&); |
101 | 98 |
102 void setScrollingPerformanceLoggingEnabled(bool flag); | 99 void setScrollingPerformanceLoggingEnabled(bool flag); |
103 bool scrollingPerformanceLoggingEnabled(); | 100 bool scrollingPerformanceLoggingEnabled(); |
104 | 101 |
105 ScrollingTreeScrollingNode* rootNode() const { return m_rootNode.get(); } | |
106 | |
107 private: | 102 private: |
108 explicit ScrollingTree(ScrollingCoordinator*); | 103 explicit ScrollingTree(ScrollingCoordinator*); |
109 | 104 |
110 void removeDestroyedNodes(ScrollingStateTree*); | 105 void removeDestroyedNodes(ScrollingStateTree*); |
111 void updateTreeFromStateNode(ScrollingStateNode*); | 106 void updateTreeFromStateNode(ScrollingStateNode*); |
112 | 107 |
113 RefPtr<ScrollingCoordinator> m_scrollingCoordinator; | 108 RefPtr<ScrollingCoordinator> m_scrollingCoordinator; |
114 OwnPtr<ScrollingTreeScrollingNode> m_rootNode; | 109 OwnPtr<ScrollingTreeScrollingNode> m_rootNode; |
115 | 110 |
116 typedef HashMap<ScrollingNodeID, ScrollingTreeNode*> ScrollingTreeNodeMap; | 111 typedef HashMap<ScrollingNodeID, ScrollingTreeNode*> ScrollingTreeNodeMap; |
117 ScrollingTreeNodeMap m_nodeMap; | 112 ScrollingTreeNodeMap m_nodeMap; |
118 | 113 |
119 Mutex m_mutex; | 114 Mutex m_mutex; |
120 Region m_nonFastScrollableRegion; | 115 Region m_nonFastScrollableRegion; |
121 IntPoint m_mainFrameScrollPosition; | 116 IntPoint m_mainFrameScrollPosition; |
122 bool m_hasWheelEventHandlers; | 117 bool m_hasWheelEventHandlers; |
123 | 118 |
124 Mutex m_swipeStateMutex; | 119 Mutex m_swipeStateMutex; |
125 bool m_canGoBack; | 120 bool m_canGoBack; |
126 bool m_canGoForward; | 121 bool m_canGoForward; |
127 bool m_mainFramePinnedToTheLeft; | 122 bool m_mainFramePinnedToTheLeft; |
128 bool m_mainFramePinnedToTheRight; | 123 bool m_mainFramePinnedToTheRight; |
129 bool m_mainFrameIsRubberBanding; | |
130 | 124 |
131 bool m_scrollingPerformanceLoggingEnabled; | 125 bool m_scrollingPerformanceLoggingEnabled; |
132 | 126 |
133 bool m_isHandlingProgrammaticScroll; | 127 bool m_isHandlingProgrammaticScroll; |
134 | 128 |
135 #if PLATFORM(MAC) | 129 #if PLATFORM(MAC) |
136 RetainPtr<CALayer> m_debugInfoLayer; | 130 RetainPtr<CALayer> m_debugInfoLayer; |
137 #endif | 131 #endif |
138 }; | 132 }; |
139 | 133 |
140 } // namespace WebCore | 134 } // namespace WebCore |
141 | 135 |
142 #endif // ENABLE(THREADED_SCROLLING) | 136 #endif // ENABLE(THREADED_SCROLLING) |
143 | 137 |
144 #endif // ScrollingTree_h | 138 #endif // ScrollingTree_h |
OLD | NEW |