- Revision
- 104879
- Author
- ander...@apple.com
- Date
- 2012-01-12 16:30:55 -0800 (Thu, 12 Jan 2012)
Log Message
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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (104878 => 104879)
--- trunk/Source/WebCore/ChangeLog 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/ChangeLog 2012-01-13 00:30:55 UTC (rev 104879)
@@ -1,3 +1,39 @@
+2012-01-12 Anders Carlsson <ander...@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 <ba...@chromium.org>
Move SimpleFontDataSkia.cpp to Source/WebCore/platform/graphics/skia
Modified: trunk/Source/WebCore/page/FrameView.cpp (104878 => 104879)
--- trunk/Source/WebCore/page/FrameView.cpp 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/page/FrameView.cpp 2012-01-13 00:30:55 UTC (rev 104879)
@@ -646,14 +646,15 @@
}
}
-#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 @@
return root->compositor()->layerForScrollCorner();
}
-#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
+#if ENABLE(RUBBER_BANDING)
GraphicsLayer* FrameView::layerForOverhangAreas() const
{
RenderView* root = rootRenderer(this);
Modified: trunk/Source/WebCore/page/FrameView.h (104878 => 104879)
--- trunk/Source/WebCore/page/FrameView.h 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/page/FrameView.h 2012-01-13 00:30:55 UTC (rev 104879)
@@ -363,11 +363,11 @@
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
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (104878 => 104879)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2012-01-13 00:30:55 UTC (rev 104879)
@@ -1075,7 +1075,7 @@
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
Modified: trunk/Source/WebCore/platform/ScrollableArea.h (104878 => 104879)
--- trunk/Source/WebCore/platform/ScrollableArea.h 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/platform/ScrollableArea.h 2012-01-13 00:30:55 UTC (rev 104879)
@@ -184,7 +184,7 @@
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
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (104878 => 104879)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-01-13 00:30:55 UTC (rev 104879)
@@ -967,7 +967,7 @@
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 @@
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 @@
#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 @@
detachRootLayer();
-#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
+#if ENABLE(RUBBER_BANDING)
if (m_layerForOverhangAreas) {
m_layerForOverhangAreas->removeFromParent();
m_layerForOverhangAreas = nullptr;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (104878 => 104879)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2012-01-13 00:29:32 UTC (rev 104878)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2012-01-13 00:30:55 UTC (rev 104879)
@@ -207,7 +207,7 @@
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 @@
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 @@
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