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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #ifndef ScrollingCoordinator_h | 26 #ifndef ScrollingCoordinator_h |
27 #define ScrollingCoordinator_h | 27 #define ScrollingCoordinator_h |
28 | 28 |
29 #include "core/rendering/RenderObject.h" | 29 #include "core/rendering/RenderObject.h" |
30 #include "platform/PlatformWheelEvent.h" | 30 #include "platform/PlatformWheelEvent.h" |
31 #include "platform/geometry/IntRect.h" | 31 #include "platform/geometry/IntRect.h" |
32 #include "platform/scroll/ScrollTypes.h" | 32 #include "platform/scroll/ScrollTypes.h" |
33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
34 | 34 |
35 namespace WebKit { | 35 namespace blink { |
36 class WebLayer; | 36 class WebLayer; |
37 class WebScrollbarLayer; | 37 class WebScrollbarLayer; |
38 } | 38 } |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 typedef unsigned MainThreadScrollingReasons; | 42 typedef unsigned MainThreadScrollingReasons; |
43 | 43 |
44 class Document; | 44 class Document; |
45 class Frame; | 45 class Frame; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 enum MainThreadScrollingReasonFlags { | 89 enum MainThreadScrollingReasonFlags { |
90 HasSlowRepaintObjects = 1 << 0, | 90 HasSlowRepaintObjects = 1 << 0, |
91 HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 1, | 91 HasViewportConstrainedObjectsWithoutSupportingFixedLayers = 1 << 1, |
92 HasNonLayerViewportConstrainedObjects = 1 << 2, | 92 HasNonLayerViewportConstrainedObjects = 1 << 2, |
93 }; | 93 }; |
94 | 94 |
95 MainThreadScrollingReasons mainThreadScrollingReasons() const; | 95 MainThreadScrollingReasons mainThreadScrollingReasons() const; |
96 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } | 96 bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThread
ScrollingReasons() != 0; } |
97 | 97 |
98 PassOwnPtr<WebKit::WebScrollbarLayer> createSolidColorScrollbarLayer(Scrollb
arOrientation, int thumbThickness, bool isLeftSideVerticalScrollbar); | 98 PassOwnPtr<blink::WebScrollbarLayer> createSolidColorScrollbarLayer(Scrollba
rOrientation, int thumbThickness, bool isLeftSideVerticalScrollbar); |
99 | 99 |
100 void willDestroyScrollableArea(ScrollableArea*); | 100 void willDestroyScrollableArea(ScrollableArea*); |
101 // Returns true if the coordinator handled this change. | 101 // Returns true if the coordinator handled this change. |
102 bool scrollableAreaScrollLayerDidChange(ScrollableArea*); | 102 bool scrollableAreaScrollLayerDidChange(ScrollableArea*); |
103 void scrollableAreaScrollbarLayerDidChange(ScrollableArea*, ScrollbarOrienta
tion); | 103 void scrollableAreaScrollbarLayerDidChange(ScrollableArea*, ScrollbarOrienta
tion); |
104 void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool); | 104 void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool); |
105 void updateLayerPositionConstraint(RenderLayer*); | 105 void updateLayerPositionConstraint(RenderLayer*); |
106 void touchEventTargetRectsDidChange(const Document*); | 106 void touchEventTargetRectsDidChange(const Document*); |
107 void willDestroyRenderLayer(RenderLayer*); | 107 void willDestroyRenderLayer(RenderLayer*); |
108 | 108 |
(...skipping 24 matching lines...) Expand all Loading... |
133 bool m_scrollGestureRegionIsDirty; | 133 bool m_scrollGestureRegionIsDirty; |
134 bool m_touchEventTargetRectsAreDirty; | 134 bool m_touchEventTargetRectsAreDirty; |
135 | 135 |
136 private: | 136 private: |
137 void recomputeWheelEventHandlerCountForFrameView(FrameView*); | 137 void recomputeWheelEventHandlerCountForFrameView(FrameView*); |
138 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); | 138 void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReaso
ns); |
139 | 139 |
140 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; | 140 bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const; |
141 void updateShouldUpdateScrollLayerPositionOnMainThread(); | 141 void updateShouldUpdateScrollLayerPositionOnMainThread(); |
142 | 142 |
143 static WebKit::WebLayer* scrollingWebLayerForScrollableArea(ScrollableArea*)
; | 143 static blink::WebLayer* scrollingWebLayerForScrollableArea(ScrollableArea*); |
144 | 144 |
145 bool touchHitTestingEnabled() const; | 145 bool touchHitTestingEnabled() const; |
146 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); | 146 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); |
147 void setTouchEventTargetRects(const LayerHitTestRects&); | 147 void setTouchEventTargetRects(const LayerHitTestRects&); |
148 void computeTouchEventTargetRects(LayerHitTestRects&); | 148 void computeTouchEventTargetRects(LayerHitTestRects&); |
149 void setWheelEventHandlerCount(unsigned); | 149 void setWheelEventHandlerCount(unsigned); |
150 | 150 |
151 WebKit::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation, PassOwnPtr<WebKit::WebScrollbarLayer>); | 151 blink::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation, PassOwnPtr<blink::WebScrollbarLayer>); |
152 WebKit::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOr
ientation); | 152 blink::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOri
entation); |
153 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); | 153 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); |
154 | 154 |
155 | 155 |
156 typedef HashMap<ScrollableArea*, OwnPtr<WebKit::WebScrollbarLayer> > Scrollb
arMap; | 156 typedef HashMap<ScrollableArea*, OwnPtr<blink::WebScrollbarLayer> > Scrollba
rMap; |
157 ScrollbarMap m_horizontalScrollbars; | 157 ScrollbarMap m_horizontalScrollbars; |
158 ScrollbarMap m_verticalScrollbars; | 158 ScrollbarMap m_verticalScrollbars; |
159 HashSet<const RenderLayer*> m_layersWithTouchRects; | 159 HashSet<const RenderLayer*> m_layersWithTouchRects; |
160 }; | 160 }; |
161 | 161 |
162 } // namespace WebCore | 162 } // namespace WebCore |
163 | 163 |
164 #endif // ScrollingCoordinator_h | 164 #endif // ScrollingCoordinator_h |
OLD | NEW |