Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.h

Issue 17471008: Rework compositor touch hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CR feedback - accumulate LayoutRects instead of IntRects, disable when page isn't composited. Also… Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/scrolling/ScrollingCoordinator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
136 bool touchHitTestingEnabled() const;
130 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&); 137 void setShouldHandleScrollGestureOnMainThreadRegion(const Region&);
131 void setTouchEventTargetRects(const Vector<IntRect>&); 138 void setTouchEventTargetRects(const LayerHitTestRects&);
139 void computeTouchEventTargetRects(LayerHitTestRects&);
132 void setWheelEventHandlerCount(unsigned); 140 void setWheelEventHandlerCount(unsigned);
133 141
134 WebKit::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOr ientation, PassOwnPtr<WebKit::WebScrollbarLayer>); 142 WebKit::WebScrollbarLayer* addWebScrollbarLayer(ScrollableArea*, ScrollbarOr ientation, PassOwnPtr<WebKit::WebScrollbarLayer>);
135 WebKit::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOr ientation); 143 WebKit::WebScrollbarLayer* getWebScrollbarLayer(ScrollableArea*, ScrollbarOr ientation);
136 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation); 144 void removeWebScrollbarLayer(ScrollableArea*, ScrollbarOrientation);
137 145
146
138 typedef HashMap<ScrollableArea*, OwnPtr<WebKit::WebScrollbarLayer> > Scrollb arMap; 147 typedef HashMap<ScrollableArea*, OwnPtr<WebKit::WebScrollbarLayer> > Scrollb arMap;
139 ScrollbarMap m_horizontalScrollbars; 148 ScrollbarMap m_horizontalScrollbars;
140 ScrollbarMap m_verticalScrollbars; 149 ScrollbarMap m_verticalScrollbars;
141 150
151 HashSet<TouchEventTargetRectsObserver*> m_touchEventTargetRectsObservers;
142 }; 152 };
143 153
144 } // namespace WebCore 154 } // namespace WebCore
145 155
146 #endif // ScrollingCoordinator_h 156 #endif // ScrollingCoordinator_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/scrolling/ScrollingCoordinator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698