Commit 134cfffe authored by andersca@apple.com's avatar andersca@apple.com

Create a GraphicsLayer for the overhang areas if threaded scrolling is enabled

https://bugs.webkit.org/show_bug.cgi?id=76220

Reviewed by Simon Fraser.

* page/FrameView.cpp:
Remove PLATFORM(CHROMIUM) #ifdefs.

* page/FrameView.h:
Ditto.

* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
Ditto.

* platform/ScrollableArea.h:
Ditto.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
Ditto.

(WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
Make this return true if we have a scrolling coordinator.

(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
Remove PLATFORM(CHROMIUM) #ifdefs. Fix a bug the overhang layer was being added above the clip layer.

(WebCore::RenderLayerCompositor::destroyRootLayer):
Remove PLATFORM(CHROMIUM) #ifdefs.

* rendering/RenderLayerCompositor.h:
Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f79c2a20
2012-01-12 Anders Carlsson <andersca@apple.com>
Create a GraphicsLayer for the overhang areas if threaded scrolling is enabled
https://bugs.webkit.org/show_bug.cgi?id=76220
Reviewed by Simon Fraser.
* page/FrameView.cpp:
Remove PLATFORM(CHROMIUM) #ifdefs.
* page/FrameView.h:
Ditto.
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
Ditto.
* platform/ScrollableArea.h:
Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
Ditto.
(WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
Make this return true if we have a scrolling coordinator.
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
Remove PLATFORM(CHROMIUM) #ifdefs. Fix a bug the overhang layer was being added above the clip layer.
(WebCore::RenderLayerCompositor::destroyRootLayer):
Remove PLATFORM(CHROMIUM) #ifdefs.
* rendering/RenderLayerCompositor.h:
Ditto.
2012-01-12 Kenichi Ishibashi <bashi@chromium.org>
Move SimpleFontDataSkia.cpp to Source/WebCore/platform/graphics/skia
......@@ -646,14 +646,15 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
}
}
#if ENABLE(FULLSCREEN_API) && USE(ACCELERATED_COMPOSITING)
#if USE(ACCELERATED_COMPOSITING)
#if ENABLE(FULLSCREEN_API)
static bool isDocumentRunningFullScreenAnimation(Document* document)
{
return document->webkitIsFullScreen() && document->fullScreenRenderer() && document->isAnimatingFullScreen();
}
#endif
#if USE(ACCELERATED_COMPOSITING)
void FrameView::updateCompositingLayers()
{
RenderView* root = rootRenderer(this);
......@@ -718,7 +719,7 @@ GraphicsLayer* FrameView::layerForScrollCorner() const
return root->compositor()->layerForScrollCorner();
}
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
GraphicsLayer* FrameView::layerForOverhangAreas() const
{
RenderView* root = rootRenderer(this);
......
......@@ -363,11 +363,11 @@ private:
virtual ScrollableArea* enclosingScrollableArea() const;
#if USE(ACCELERATED_COMPOSITING)
virtual GraphicsLayer* layerForHorizontalScrollbar() const;
virtual GraphicsLayer* layerForVerticalScrollbar() const;
virtual GraphicsLayer* layerForScrollCorner() const;
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
virtual GraphicsLayer* layerForOverhangAreas() const;
virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
#if ENABLE(RUBBER_BANDING)
virtual GraphicsLayer* layerForOverhangAreas() const OVERRIDE;
#endif
#endif
......
......@@ -1075,7 +1075,7 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
paintContents(context, documentDirtyRect);
}
#if USE(ACCELERATED_COMPOSITING) && PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
if (!layerForOverhangAreas())
calculateAndPaintOverhangAreas(context, rect);
#else
......
......@@ -184,7 +184,7 @@ protected:
virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
virtual GraphicsLayer* layerForScrollCorner() const { return 0; }
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
virtual GraphicsLayer* layerForOverhangAreas() const { return 0; }
#endif
#endif
......
......@@ -967,7 +967,7 @@ void RenderLayerCompositor::frameViewDidChangeSize()
m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
updateOverflowControlsLayers();
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
if (m_layerForOverhangAreas)
m_layerForOverhangAreas->setSize(frameView->frameRect().size());
#endif
......@@ -1685,17 +1685,31 @@ bool RenderLayerCompositor::requiresScrollCornerLayer() const
return shouldCompositeOverflowControls(view) && view->isScrollCornerVisible();
}
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
bool RenderLayerCompositor::requiresOverhangAreasLayer() const
{
// Only if this is a top level frame (not iframe).
return !m_renderView->document()->ownerElement();
// We don't want a layer if this is a subframe.
if (m_renderView->document()->ownerElement())
return false;
// We do want a layer if we have a scrolling coordinator.
#if ENABLE(THREADED_SCROLLING)
if (scrollingCoordinator())
return true;
#endif
// Chromium always wants a layer.
#if PLATFORM(CHROMIUM)
return true;
#endif
return false;
}
#endif
void RenderLayerCompositor::updateOverflowControlsLayers()
{
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
if (requiresOverhangAreasLayer()) {
if (!m_layerForOverhangAreas) {
m_layerForOverhangAreas = GraphicsLayer::create(this);
......@@ -1704,7 +1718,10 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
#endif
m_layerForOverhangAreas->setDrawsContent(false);
m_layerForOverhangAreas->setSize(m_renderView->frameView()->frameRect().size());
m_overflowControlsHostLayer->addChild(m_layerForOverhangAreas.get());
// We want the overhang areas layer to be positioned below the frame contents,
// so insert it below the clip layer.
m_overflowControlsHostLayer->addChildBelow(m_layerForOverhangAreas.get(), m_clipLayer.get());
}
} else if (m_layerForOverhangAreas) {
m_layerForOverhangAreas->removeFromParent();
......@@ -1850,7 +1867,7 @@ void RenderLayerCompositor::destroyRootLayer()
detachRootLayer();
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
if (m_layerForOverhangAreas) {
m_layerForOverhangAreas->removeFromParent();
m_layerForOverhangAreas = nullptr;
......
......@@ -207,7 +207,7 @@ public:
GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
#endif
......@@ -293,7 +293,7 @@ private:
bool requiresHorizontalScrollbarLayer() const;
bool requiresVerticalScrollbarLayer() const;
bool requiresScrollCornerLayer() const;
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
bool requiresOverhangAreasLayer() const;
#endif
......@@ -339,7 +339,7 @@ private:
OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
OwnPtr<GraphicsLayer> m_layerForScrollCorner;
#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
#if ENABLE(RUBBER_BANDING)
OwnPtr<GraphicsLayer> m_layerForOverhangAreas;
#endif
#if PROFILE_LAYER_REBUILD
......
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