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

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

Powered by Google App Engine
This is Rietveld 408576698