Commit 858b2025 authored by ccameron@chromium.org's avatar ccameron@chromium.org

Add development Blink setting for impl-side rubber-banding

Add a flag to indicate if the compositor thread is performing the
Mac overscroll rubber-band bounce effect.

This is false by default and will be set to true by
--enable-threaded-event-handling-mac until developement is finished,
whereupon it will be true by default and removed.

BUG=133097
TBR=dglazkov

Review URL: https://codereview.chromium.org/722353002

git-svn-id: svn://svn.chromium.org/blink/trunk@185385 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b7c1115d
......@@ -1673,6 +1673,11 @@ bool FrameView::isRubberBandInProgress() const
return false;
}
bool FrameView::rubberBandingOnCompositorThread() const
{
return m_frame->settings()->rubberBandingOnCompositorThread();
}
HostWindow* FrameView::hostWindow() const
{
Page* page = frame().page();
......
......@@ -163,6 +163,7 @@ public:
void setScrollPosition(const DoublePoint&, ScrollBehavior = ScrollBehaviorInstant);
virtual bool isRubberBandInProgress() const override;
virtual bool rubberBandingOnCompositorThread() const override;
void setScrollPositionNonProgrammatically(const IntPoint&);
// This is different than visibleContentRect() in that it ignores negative (or overly positive)
......
......@@ -224,6 +224,11 @@ pinchVirtualViewportEnabled initial=false
useSolidColorScrollbars initial=false
pinchOverlayScrollbarThickness type=int, initial=0
# The rubber-band overscroll effect is implemented in Blink and is being moved
# to the compositor thread. This will be set to true and eventually removed.
# crbug.com/133097
rubberBandingOnCompositorThread initial=false
mainFrameClipsContent initial=true
......
......@@ -901,7 +901,7 @@ bool RenderLayerCompositor::requiresScrollCornerLayer() const
void RenderLayerCompositor::updateOverflowControlsLayers()
{
#if USE(RUBBER_BANDING)
if (m_renderView.frame()->isLocalRoot()) {
if (m_renderView.frame()->isLocalRoot() && !m_renderView.document().settings()->rubberBandingOnCompositorThread()) {
if (!m_layerForOverhangShadow) {
m_layerForOverhangShadow = GraphicsLayer::create(graphicsLayerFactory(), this);
OverscrollTheme::theme()->setUpOverhangShadowLayer(m_layerForOverhangShadow.get());
......
......@@ -1080,7 +1080,7 @@ bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;
if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem())
if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem() || m_scrollableArea->rubberBandingOnCompositorThread())
return ScrollAnimator::handleWheelEvent(wheelEvent);
// FIXME: This is somewhat roundabout hack to allow forwarding wheel events
......
......@@ -185,6 +185,7 @@ public:
virtual IntRect scrollableAreaBoundingBox() const = 0;
virtual bool isRubberBandInProgress() const { return false; }
virtual bool rubberBandingOnCompositorThread() const { return false; }
virtual bool scrollAnimatorEnabled() const { return false; }
......
......@@ -251,6 +251,11 @@ void WebSettingsImpl::setRootLayerScrolls(bool rootLayerScrolls)
m_settings->setRootLayerScrolls(rootLayerScrolls);
}
void WebSettingsImpl::setRubberBandingOnCompositorThread(bool rubberBandingOnCompositorThread)
{
m_settings->setRubberBandingOnCompositorThread(rubberBandingOnCompositorThread);
}
void WebSettingsImpl::setClobberUserAgentInitialScaleQuirk(bool clobberUserAgentInitialScaleQuirk)
{
m_clobberUserAgentInitialScaleQuirk = clobberUserAgentInitialScaleQuirk;
......
......@@ -135,6 +135,7 @@ public:
virtual void setRenderVSyncNotificationEnabled(bool) override;
virtual void setReportScreenSizeInPhysicalPixelsQuirk(bool) override;
virtual void setRootLayerScrolls(bool) override;
virtual void setRubberBandingOnCompositorThread(bool) override;
virtual void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
virtual void setSelectTrailingWhitespaceEnabled(bool override);
virtual void setSelectionIncludesAltImageText(bool) override;
......
......@@ -186,6 +186,7 @@ public:
virtual void setRenderVSyncNotificationEnabled(bool) = 0;
virtual void setReportScreenSizeInPhysicalPixelsQuirk(bool) = 0;
virtual void setRootLayerScrolls(bool) = 0;
virtual void setRubberBandingOnCompositorThread(bool) = 0;
virtual void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0;
virtual void setSelectTrailingWhitespaceEnabled(bool) = 0;
virtual void setSelectionIncludesAltImageText(bool) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment