Changeset 98778 in webkit
- Timestamp:
- Oct 28, 2011, 4:30:07 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (modified) (3 diffs)
-
WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (modified) (3 diffs)
-
WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h (modified) (3 diffs)
-
WebCore/platform/graphics/chromium/cc/CCScrollController.h (modified) (1 diff)
-
WebKit/chromium/ChangeLog (modified) (1 diff)
-
WebKit/chromium/src/ChromeClientImpl.cpp (modified) (1 diff)
-
WebKit/chromium/src/WebCompositorImpl.cpp (modified) (1 diff)
-
WebKit/chromium/src/WebViewImpl.cpp (modified) (2 diffs)
-
WebKit/chromium/src/WebViewImpl.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98777 r98778 1 2011-10-28 James Robinson <jamesr@chromium.org> 2 3 [chromium] Track wheel event handler registration and pass to input filter 4 https://bugs.webkit.org/show_bug.cgi?id=71078 5 6 Reviewed by Kenneth Russell. 7 8 This propagates mouse wheel registration notifications to the compositor input filter. If there are any handlers 9 registered, which includes JS handlers and scrollable areas other than the main view, the input filter will pass 10 mouse wheel events to the widget. Otherwise when threaded compositing is enabled the input filter translates 11 wheel events into root layer scrolling. 12 13 Only changes behavior with an off-by-default flag enabled, so no tests. 14 15 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 16 (WebCore::CCLayerTreeHost::CCLayerTreeHost): 17 (WebCore::CCLayerTreeHost::finishCommitOnImplThread): 18 (WebCore::CCLayerTreeHost::setHaveWheelEventHandlers): 19 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 20 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: 21 (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl): 22 (WebCore::CCLayerTreeHostImpl::haveWheelEventHandlers): 23 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: 24 (WebCore::CCLayerTreeHostImpl::setHaveWheelEventHandlers): 25 * platform/graphics/chromium/cc/CCScrollController.h: 26 1 27 2011-10-28 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r98771 r98778 57 57 , m_settings(settings) 58 58 , m_visible(true) 59 , m_haveWheelEventHandlers(false) 59 60 { 60 61 CCMainThread::initialize(); … … 129 130 hostImpl->setSourceFrameNumber(frameNumber()); 130 131 hostImpl->setVisible(m_visible); 132 hostImpl->setHaveWheelEventHandlers(m_haveWheelEventHandlers); 131 133 hostImpl->setZoomAnimatorTransform(m_zoomAnimatorTransform); 132 134 hostImpl->setViewport(viewportSize()); … … 236 238 } 237 239 } 240 241 void CCLayerTreeHost::setHaveWheelEventHandlers(bool haveWheelEventHandlers) 242 { 243 if (m_haveWheelEventHandlers == haveWheelEventHandlers) 244 return; 245 m_haveWheelEventHandlers = haveWheelEventHandlers; 246 m_proxy->setNeedsCommit(); 247 } 248 238 249 239 250 void CCLayerTreeHost::loseCompositorContext(int numTimes) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r98471 r98778 158 158 159 159 void setVisible(bool); 160 void setHaveWheelEventHandlers(bool); 160 161 161 162 void updateLayers(); … … 165 166 void startRateLimiter(GraphicsContext3D*); 166 167 void stopRateLimiter(GraphicsContext3D*); 168 167 169 protected: 168 170 CCLayerTreeHost(CCLayerTreeHostClient*, PassRefPtr<LayerChromium> rootLayer, const CCSettings&); … … 199 201 TransformationMatrix m_zoomAnimatorTransform; 200 202 bool m_visible; 203 bool m_haveWheelEventHandlers; 201 204 typedef HashMap<GraphicsContext3D*, RefPtr<RateLimiter> > RateLimiterMap; 202 205 RateLimiterMap m_rateLimiters; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r98392 r98778 50 50 , m_settings(settings) 51 51 , m_visible(true) 52 , m_haveWheelEventHandlers(false) 52 53 { 53 54 ASSERT(CCProxy::isImplThread()); … … 180 181 m_client->setNeedsCommitOnImplThread(); 181 182 m_client->setNeedsRedrawOnImplThread(); 183 } 184 185 bool CCLayerTreeHostImpl::haveWheelEventHandlers() 186 { 187 return m_haveWheelEventHandlers; 182 188 } 183 189 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r98392 r98778 61 61 // CCScrollController implementation 62 62 virtual void scrollRootLayer(const IntSize&); 63 virtual bool haveWheelEventHandlers(); 63 64 64 65 // Virtual for testing … … 87 88 88 89 void setVisible(bool); 90 void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEventHandlers = haveWheelEventHandlers; } 89 91 90 92 int sourceFrameNumber() const { return m_sourceFrameNumber; } … … 111 113 IntSize m_viewportSize; 112 114 bool m_visible; 115 bool m_haveWheelEventHandlers; 113 116 }; 114 117 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollController.h
r96736 r98778 36 36 public: 37 37 virtual void scrollRootLayer(const IntSize&) = 0; 38 virtual bool haveWheelEventHandlers() = 0; 38 39 39 40 protected: -
trunk/Source/WebKit/chromium/ChangeLog
r98730 r98778 1 2011-10-28 James Robinson <jamesr@chromium.org> 2 3 [chromium] Track wheel event handler registration and pass to input filter 4 https://bugs.webkit.org/show_bug.cgi?id=71078 5 6 Reviewed by Kenneth Russell. 7 8 Pushes mouse wheel event handler notifications to CCLayerTreeHost when compositing. 9 10 * src/ChromeClientImpl.cpp: 11 (WebKit::ChromeClientImpl::numWheelEventHandlersChanged): 12 * src/WebCompositorImpl.cpp: 13 (WebKit::WebCompositorImpl::handleInputEvent): 14 * src/WebViewImpl.cpp: 15 (WebKit::WebViewImpl::numberOfWheelEventHandlersChanged): 16 (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): 17 * src/WebViewImpl.h: 18 1 19 2011-10-28 Jochen Eisinger <jochen@chromium.org> 2 20 -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r97922 r98778 1000 1000 void ChromeClientImpl::numWheelEventHandlersChanged(unsigned numberOfWheelHandlers) 1001 1001 { 1002 if (m_webView->client()) 1003 m_webView->client()->numberOfWheelEventHandlersChanged(numberOfWheelHandlers); 1002 m_webView->numberOfWheelEventHandlersChanged(numberOfWheelHandlers); 1004 1003 } 1005 1004 -
trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp
r98445 r98778 117 117 ASSERT(CCProxy::isImplThread()); 118 118 ASSERT(m_client); 119 // FIXME: Do something interesting with this input event like inform our m_scrollController. 119 120 if (event.type == WebInputEvent::MouseWheel && !m_scrollController->haveWheelEventHandlers()) { 121 const WebMouseWheelEvent& wheelEvent = *static_cast<const WebMouseWheelEvent*>(&event); 122 m_scrollController->scrollRootLayer(IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY)); 123 m_client->didHandleInputEvent(); 124 return; 125 } 120 126 m_client->didNotHandleInputEvent(true /* sendToWidget */); 121 127 } -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r98669 r98778 782 782 #endif 783 783 784 void WebViewImpl::numberOfWheelEventHandlersChanged(unsigned numberOfWheelHandlers) 785 { 786 m_haveWheelEventHandlers = numberOfWheelHandlers > 0; 787 if (m_client) 788 m_client->numberOfWheelEventHandlersChanged(numberOfWheelHandlers); 789 #if USE(ACCELERATED_COMPOSITING) 790 if (m_layerTreeHost) 791 m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers); 792 #endif 793 } 794 784 795 #if !OS(DARWIN) 785 796 // Mac has no way to open a context menu based on a keyboard event. … … 2613 2624 m_layerTreeHost = CCLayerTreeHost::create(this, m_nonCompositedContentHost->topLevelRootLayer()->platformLayer(), ccSettings); 2614 2625 if (m_layerTreeHost) { 2626 m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers); 2615 2627 updateLayerTreeViewport(); 2616 2628 m_client->didActivateCompositor(m_layerTreeHost->compositorIdentifier()); -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r98669 r98778 295 295 bool touchEvent(const WebTouchEvent&); 296 296 297 void numberOfWheelEventHandlersChanged(unsigned); 298 297 299 // Handles context menu events orignated via the the keyboard. These 298 300 // include the VK_APPS virtual key and the Shift+F10 combine. Code is … … 579 581 bool m_recreatingGraphicsContext; 580 582 #endif 583 bool m_haveWheelEventHandlers; 581 584 static const WebInputEvent* m_currentInputEvent; 582 585
Note:
See TracChangeset
for help on using the changeset viewer.