Diff
Modified: trunk/Source/WebCore/ChangeLog (108697 => 108698)
--- trunk/Source/WebCore/ChangeLog 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/ChangeLog 2012-02-24 00:29:53 UTC (rev 108698)
@@ -1,3 +1,70 @@
+2012-02-21 James Robinson <[email protected]>
+
+ [chromium] Notify compositor of wheel event registration via ScrollingCoordinator
+ https://bugs.webkit.org/show_bug.cgi?id=79133
+
+ Reviewed by Dimitri Glazkov.
+
+ This notifies the chromium compositor of changes to the number of wheel event handlers via ScrollingCoordinator
+ instead of through ChromeClient/WebViewImpl. This is the path we'll use for other properties in the future and
+ is more extensible for handling things other than the root layer.
+
+ Property behavior is covered by new unit tests in LayerChromiumTests and CCLayerTreeHostImplTest.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore):
+ (ScrollingCoordinator):
+ Add a ScrollingCoordinatorPrivate so implementations can tack on additional data without having to #ifdef up
+ ScrollingCoordinator.h/cpp
+ * page/scrolling/ScrollingCoordinatorNone.cpp:
+ (WebCore):
+ (WebCore::ScrollingCoordinator::~ScrollingCoordinator):
+ * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+ (ScrollingCoordinatorPrivate):
+ ScrollingCoordinatorPrivate in the chromium implementation keeps a reference to the scroll layer.
+ (WebCore::ScrollingCoordinatorPrivate::ScrollingCoordinatorPrivate):
+ (WebCore::ScrollingCoordinatorPrivate::~ScrollingCoordinatorPrivate):
+ (WebCore::ScrollingCoordinatorPrivate::setScrollLayer):
+ (WebCore::ScrollingCoordinatorPrivate::scrollLayer):
+ (WebCore):
+ (WebCore::ScrollingCoordinator::create):
+ (WebCore::ScrollingCoordinator::~ScrollingCoordinator):
+ (WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange):
+ (WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange):
+ (WebCore::ScrollingCoordinator::setScrollLayer):
+ (WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
+ (WebCore::ScrollingCoordinator::setScrollParameters):
+ (WebCore::ScrollingCoordinator::setWheelEventHandlerCount):
+ (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+ (WebCore):
+ (WebCore::ScrollingCoordinator::~ScrollingCoordinator):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::LayerChromium):
+ (WebCore::LayerChromium::setHaveWheelEventHandlers):
+ (WebCore):
+ (WebCore::LayerChromium::pushPropertiesTo):
+ * platform/graphics/chromium/LayerChromium.h:
+ (LayerChromium):
+ * platform/graphics/chromium/cc/CCInputHandler.h:
+ * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+ (WebCore::CCLayerImpl::CCLayerImpl):
+ * platform/graphics/chromium/cc/CCLayerImpl.h:
+ (WebCore::CCLayerImpl::haveWheelEventHandlers):
+ (WebCore::CCLayerImpl::setHaveWheelEventHandlers):
+ (CCLayerImpl):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::CCLayerTreeHost):
+ (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+ (WebCore::CCLayerTreeHostImpl::scrollBegin):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ (CCLayerTreeHostImpl):
+
2012-02-23 No'am Rosenthal <[email protected]>
[Qt][WK2] Clipping is broken
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (108697 => 108698)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -61,14 +61,6 @@
{
}
-ScrollingCoordinator::~ScrollingCoordinator()
-{
- ASSERT(!m_page);
-#if ENABLE(THREADED_SCROLLING)
- ASSERT(!m_scrollingTree);
-#endif
-}
-
void ScrollingCoordinator::pageDestroyed()
{
ASSERT(m_page);
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (108697 => 108698)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -48,6 +48,7 @@
class Page;
class PlatformWheelEvent;
class Region;
+class ScrollingCoordinatorPrivate;
class ScrollingTreeState;
#if ENABLE(THREADED_SCROLLING)
@@ -133,6 +134,8 @@
RefPtr<ScrollingTree> m_scrollingTree;
Timer<ScrollingCoordinator> m_scrollingTreeStateCommitterTimer;
#endif
+
+ ScrollingCoordinatorPrivate* m_private;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp (108697 => 108698)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -29,12 +29,20 @@
namespace WebCore {
+class ScrollingCoordinatorPrivate {
+};
+
#if !ENABLE(THREADED_SCROLLING)
PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
return adoptRef(new ScrollingCoordinator(page));
}
+ScrollingCoordinator::~ScrollingCoordinator()
+{
+ ASSERT(!m_page);
+}
+
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*)
{
}
Modified: trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (108697 => 108698)
--- trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -27,13 +27,37 @@
#include "ScrollingCoordinator.h"
+#include "LayerChromium.h"
+#include "Region.h"
+
namespace WebCore {
+class ScrollingCoordinatorPrivate {
+WTF_MAKE_NONCOPYABLE(ScrollingCoordinatorPrivate);
+public:
+ ScrollingCoordinatorPrivate() { }
+ ~ScrollingCoordinatorPrivate() { }
+
+ void setScrollLayer(LayerChromium* layer) { m_scrollLayer = layer; }
+ LayerChromium* scrollLayer() const { return m_scrollLayer.get(); }
+
+private:
+ RefPtr<LayerChromium> m_scrollLayer;
+};
+
PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
- return adoptRef(new ScrollingCoordinator(page));
+ RefPtr<ScrollingCoordinator> coordinator(adoptRef(new ScrollingCoordinator(page)));
+ coordinator->m_private = new ScrollingCoordinatorPrivate;
+ return coordinator.release();
}
+ScrollingCoordinator::~ScrollingCoordinator()
+{
+ ASSERT(!m_page);
+ delete m_private;
+}
+
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer* horizontalScrollbarLayer)
{
// FIXME: Implement!
@@ -46,7 +70,7 @@
void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
{
- // FIXME: Implement!
+ m_private->setScrollLayer(scrollLayer ? scrollLayer->platformLayer() : 0);
}
void ScrollingCoordinator::setNonFastScrollableRegion(const Region&)
@@ -61,12 +85,13 @@
// FIXME: Implement!
}
-void ScrollingCoordinator::setWheelEventHandlerCount(unsigned)
+void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
- // FIXME: Implement!
+ if (LayerChromium* layer = m_private->scrollLayer())
+ layer->setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
}
-void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool)
+void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool should)
{
// FIXME: Implement!
}
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (108697 => 108698)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2012-02-24 00:29:53 UTC (rev 108698)
@@ -42,11 +42,19 @@
namespace WebCore {
+class ScrollingCoordinatorPrivate {
+};
+
PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
return adoptRef(new ScrollingCoordinator(page));
}
+ScrollingCoordinator::~ScrollingCoordinator()
+{
+ ASSERT(!m_page);
+ ASSERT(!m_scrollingTree);
+}
void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer*)
{
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -62,6 +62,7 @@
, m_parent(0)
, m_layerAnimationController(CCLayerAnimationController::create())
, m_scrollable(false)
+ , m_haveWheelEventHandlers(false)
, m_anchorPoint(0.5, 0.5)
, m_backgroundColor(0, 0, 0, 0)
, m_backgroundCoversViewport(false)
@@ -412,6 +413,14 @@
setNeedsCommit();
}
+void LayerChromium::setHaveWheelEventHandlers(bool haveWheelEventHandlers)
+{
+ if (m_haveWheelEventHandlers == haveWheelEventHandlers)
+ return;
+ m_haveWheelEventHandlers = haveWheelEventHandlers;
+ setNeedsCommit();
+}
+
void LayerChromium::setDoubleSided(bool doubleSided)
{
if (m_doubleSided == doubleSided)
@@ -466,6 +475,7 @@
layer->setIsNonCompositedContent(m_isNonCompositedContent);
layer->setMasksToBounds(m_masksToBounds);
layer->setScrollable(m_scrollable);
+ layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
layer->setName(m_name);
layer->setOpaque(m_opaque);
layer->setOpacity(m_opacity);
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -131,7 +131,7 @@
const IntPoint& scrollPosition() const { return m_scrollPosition; }
void setScrollable(bool);
- bool scrollable() const { return m_scrollable; }
+ void setHaveWheelEventHandlers(bool);
IntSize scrollDelta() const { return IntSize(); }
@@ -275,6 +275,7 @@
IntRect m_visibleLayerRect;
IntPoint m_scrollPosition;
bool m_scrollable;
+ bool m_haveWheelEventHandlers;
FloatPoint m_position;
FloatPoint m_anchorPoint;
Color m_backgroundColor;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -46,13 +46,14 @@
virtual void setNeedsRedraw() = 0;
enum ScrollStatus { ScrollFailed, ScrollStarted, ScrollIgnored };
+ enum ScrollInputType { Gesture, Wheel };
// Attempt to start scrolling a layer at a given point in window
// coordinates. Returns ScrollStarted if the layer at the coordinates can
// be scrolled, ScrollFailed if the scroll event should instead be
// delegated to the main thread, or ScrollIgnored if there is nothing to
// be scrolled at the given coordinates.
- virtual ScrollStatus scrollBegin(const IntPoint&) = 0;
+ virtual ScrollStatus scrollBegin(const IntPoint&, ScrollInputType) = 0;
// Scroll the layer selected with scrollBegin(). If there is no room to
// move the layer in the requested direction, its first ancestor layer that
@@ -64,7 +65,6 @@
// called if scrollBegin() returned ScrollStarted.
virtual void scrollEnd() = 0;
- virtual bool haveWheelEventHandlers() = 0;
virtual void pinchGestureBegin() = 0;
virtual void pinchGestureUpdate(float magnifyDelta, const IntPoint& anchor) = 0;
virtual void pinchGestureEnd() = 0;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -46,6 +46,7 @@
, m_anchorPoint(0.5, 0.5)
, m_anchorPointZ(0)
, m_scrollable(false)
+ , m_haveWheelEventHandlers(false)
, m_backgroundCoversViewport(false)
, m_doubleSided(true)
, m_layerPropertyChanged(false)
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -181,6 +181,9 @@
bool scrollable() const { return m_scrollable; }
void setScrollable(bool scrollable) { m_scrollable = scrollable; }
+ bool haveWheelEventHandlers() const { return m_haveWheelEventHandlers; }
+ void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEventHandlers = haveWheelEventHandlers; }
+
const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
@@ -245,6 +248,7 @@
IntSize m_contentBounds;
IntPoint m_scrollPosition;
bool m_scrollable;
+ bool m_haveWheelEventHandlers;
Color m_backgroundColor;
bool m_backgroundCoversViewport;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -68,7 +68,6 @@
, m_layerRendererInitialized(false)
, m_settings(settings)
, m_visible(true)
- , m_haveWheelEventHandlers(false)
, m_pageScaleFactor(1)
, m_minPageScaleFactor(1)
, m_maxPageScaleFactor(1)
@@ -179,7 +178,6 @@
hostImpl->setRootLayer(0);
hostImpl->setSourceFrameNumber(frameNumber());
- hostImpl->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
hostImpl->setViewportSize(viewportSize());
hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor);
@@ -351,14 +349,6 @@
hostImpl->setRootLayer(0);
}
-void CCLayerTreeHost::setHaveWheelEventHandlers(bool haveWheelEventHandlers)
-{
- if (m_haveWheelEventHandlers == haveWheelEventHandlers)
- return;
- m_haveWheelEventHandlers = haveWheelEventHandlers;
- m_proxy->setNeedsCommit();
-}
-
void CCLayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double durationSec)
{
m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, durationSec);
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -185,8 +185,6 @@
bool visible() const { return m_visible; }
void setVisible(bool);
- void setHaveWheelEventHandlers(bool);
-
// Returns false if we should abort this frame due to initialization failure.
bool updateLayers();
@@ -240,7 +238,6 @@
IntSize m_viewportSize;
bool m_visible;
- bool m_haveWheelEventHandlers;
typedef HashMap<GraphicsContext3D*, RefPtr<RateLimiter> > RateLimiterMap;
RateLimiterMap m_rateLimiters;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -52,7 +52,6 @@
, m_frameNumber(0)
, m_settings(settings)
, m_visible(true)
- , m_haveWheelEventHandlers(false)
, m_pageScale(1)
, m_pageScaleDelta(1)
, m_sentPageScaleDelta(1)
@@ -486,12 +485,19 @@
m_client->setNeedsRedrawOnImplThread();
}
-CCInputHandlerClient::ScrollStatus CCLayerTreeHostImpl::scrollBegin(const IntPoint&)
+CCInputHandlerClient::ScrollStatus CCLayerTreeHostImpl::scrollBegin(const IntPoint& point, CCInputHandlerClient::ScrollInputType type)
{
// TODO: Check for scrollable sublayers.
- if (!m_scrollLayerImpl || !m_scrollLayerImpl->scrollable())
+ if (!m_scrollLayerImpl || !m_scrollLayerImpl->scrollable()) {
+ TRACE_EVENT("scrollBegin Ignored no scrollable", this, 0);
return ScrollIgnored;
+ }
+ if (type == CCInputHandlerClient::Wheel && m_scrollLayerImpl->haveWheelEventHandlers()) {
+ TRACE_EVENT("scrollBegin Failed wheelEventHandlers", this, 0);
+ return ScrollFailed;
+ }
+
return ScrollStarted;
}
@@ -510,11 +516,6 @@
{
}
-bool CCLayerTreeHostImpl::haveWheelEventHandlers()
-{
- return m_haveWheelEventHandlers;
-}
-
void CCLayerTreeHostImpl::pinchGestureBegin()
{
m_pinchGestureActive = true;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h (108697 => 108698)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -62,10 +62,9 @@
// CCInputHandlerClient implementation
virtual void setNeedsRedraw();
- virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&);
+ virtual CCInputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, CCInputHandlerClient::ScrollInputType);
virtual void scrollBy(const IntSize&);
virtual void scrollEnd();
- virtual bool haveWheelEventHandlers();
virtual void pinchGestureBegin();
virtual void pinchGestureUpdate(float, const IntPoint&);
virtual void pinchGestureEnd();
@@ -101,7 +100,6 @@
bool visible() const { return m_visible; }
void setVisible(bool);
- void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEventHandlers = haveWheelEventHandlers; }
int sourceFrameNumber() const { return m_sourceFrameNumber; }
void setSourceFrameNumber(int frameNumber) { m_sourceFrameNumber = frameNumber; }
@@ -160,7 +158,6 @@
CCSettings m_settings;
IntSize m_viewportSize;
bool m_visible;
- bool m_haveWheelEventHandlers;
float m_pageScale;
float m_pageScaleDelta;
Modified: trunk/Source/WebKit/chromium/ChangeLog (108697 => 108698)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-02-24 00:29:53 UTC (rev 108698)
@@ -1,3 +1,26 @@
+2012-02-21 James Robinson <[email protected]>
+
+ [chromium] Notify compositor of wheel event registration via ScrollingCoordinator
+ https://bugs.webkit.org/show_bug.cgi?id=79133
+
+ Reviewed by Dimitri Glazkov.
+
+ Rips out old wheel event notification and adds unit tests for new LayerChromium property.
+
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::setViewport):
+ * src/WebCompositorInputHandlerImpl.cpp:
+ (WebKit::WebCompositorInputHandlerImpl::handleInputEvent):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::numberOfWheelEventHandlersChanged):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ * src/WebViewImpl.h:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKit::TEST_F):
+ (WebKit):
+ * tests/LayerChromiumTest.cpp:
+ * tests/WebCompositorInputHandlerImplTest.cpp:
+
2012-02-23 Adrienne Walker <[email protected]>
Unreviewed, rolling out r108666.
Modified: trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp (108697 => 108698)
--- trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -121,9 +121,9 @@
ASSERT(CCProxy::isImplThread());
ASSERT(m_client);
- if (event.type == WebInputEvent::MouseWheel && !m_inputHandlerClient->haveWheelEventHandlers()) {
+ if (event.type == WebInputEvent::MouseWheel) {
const WebMouseWheelEvent& wheelEvent = *static_cast<const WebMouseWheelEvent*>(&event);
- CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(wheelEvent.x, wheelEvent.y));
+ CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(wheelEvent.x, wheelEvent.y), CCInputHandlerClient::Wheel);
switch (scrollStatus) {
case CCInputHandlerClient::ScrollStarted:
m_inputHandlerClient->scrollBy(IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY));
@@ -143,7 +143,7 @@
m_expectScrollUpdateEnd = true;
#endif
const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
- CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y));
+ CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y), CCInputHandlerClient::Gesture);
switch (scrollStatus) {
case CCInputHandlerClient::ScrollStarted:
m_scrollStarted = true;
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (108697 => 108698)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -948,13 +948,8 @@
void WebViewImpl::numberOfWheelEventHandlersChanged(unsigned numberOfWheelHandlers)
{
- m_haveWheelEventHandlers = numberOfWheelHandlers > 0;
if (m_client)
m_client->numberOfWheelEventHandlersChanged(numberOfWheelHandlers);
-#if USE(ACCELERATED_COMPOSITING)
- if (m_layerTreeHost)
- m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
-#endif
}
void WebViewImpl::numberOfTouchEventHandlersChanged(unsigned numberOfTouchHandlers)
@@ -3178,7 +3173,6 @@
m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings);
if (m_layerTreeHost) {
- m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
m_layerTreeHost->setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
updateLayerTreeViewport();
m_client->didActivateCompositor(m_layerTreeHost->compositorIdentifier());
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (108697 => 108698)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-02-24 00:29:53 UTC (rev 108698)
@@ -692,7 +692,6 @@
// If true, the graphics context is being restored.
bool m_recreatingGraphicsContext;
#endif
- bool m_haveWheelEventHandlers;
static const WebInputEvent* m_currentInputEvent;
#if ENABLE(INPUT_SPEECH)
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (108697 => 108698)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -165,13 +165,28 @@
root->setScrollPosition(IntPoint(0, 0));
root->setMaxScrollPosition(IntSize(100, 100));
m_hostImpl->setRootLayer(root);
- EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0)), CCInputHandlerClient::ScrollStarted);
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted);
m_hostImpl->scrollBy(IntSize(0, 10));
m_hostImpl->scrollEnd();
EXPECT_TRUE(m_didRequestRedraw);
EXPECT_TRUE(m_didRequestCommit);
}
+TEST_F(CCLayerTreeHostImplTest, wheelEventHandlers)
+{
+ RefPtr<CCLayerImpl> root = CCLayerImpl::create(0);
+ root->setScrollable(true);
+ root->setScrollPosition(IntPoint(0, 0));
+ root->setMaxScrollPosition(IntSize(100, 100));
+ m_hostImpl->setRootLayer(root);
+ root->setHaveWheelEventHandlers(true);
+ // With registered event handlers, wheel scrolls have to go to the main thread.
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollFailed);
+
+ // But gesture scrolls can still be handled.
+ EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Gesture), CCInputHandlerClient::ScrollStarted);
+}
+
TEST_F(CCLayerTreeHostImplTest, pinchGesture)
{
setupScrollAndContentsLayers(IntSize(100, 100));
Modified: trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp (108697 => 108698)
--- trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -515,6 +515,7 @@
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setReplicaLayer(dummyLayer.get()));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setSublayerTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setScrollable(true));
+ EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setHaveWheelEventHandlers(true));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setScrollPosition(IntPoint(10, 10)));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setDoubleSided(false));
Modified: trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp (108697 => 108698)
--- trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp 2012-02-24 00:26:10 UTC (rev 108697)
+++ trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp 2012-02-24 00:29:53 UTC (rev 108698)
@@ -67,14 +67,13 @@
private:
virtual void setNeedsRedraw() OVERRIDE { }
- virtual ScrollStatus scrollBegin(const WebCore::IntPoint&) OVERRIDE
+ virtual ScrollStatus scrollBegin(const WebCore::IntPoint&, WebCore::CCInputHandlerClient::ScrollInputType) OVERRIDE
{
return m_scrollStatus;
}
virtual void scrollBy(const WebCore::IntSize&) OVERRIDE { }
virtual void scrollEnd() OVERRIDE { }
- virtual bool haveWheelEventHandlers() OVERRIDE { return false; }
virtual void pinchGestureBegin() OVERRIDE
{
m_pinchStarted = true;