summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit/chromium/src/NonCompositedContentHost.cpp
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit/chromium/src/NonCompositedContentHost.cpp')
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index edf1da7a3..5f43a9ab3 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -45,6 +45,7 @@ NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPain
#endif
m_graphicsLayer->setDrawsContent(true);
m_graphicsLayer->platformLayer()->setIsNonCompositedContent(true);
+ m_graphicsLayer->platformLayer()->setBackgroundCoversViewport(true);
m_graphicsLayer->platformLayer()->setOpaque(true);
}
@@ -77,6 +78,20 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer)
ASSERT(scrollLayer());
}
+static void reserveScrollbarLayers(WebCore::LayerChromium* layer, WebCore::LayerChromium* clipLayer)
+{
+ // Scrollbars and corners are known to be attached outside the root clip
+ // rect, so skip the clipLayer subtree.
+ if (layer == clipLayer)
+ return;
+
+ for (size_t i = 0; i < layer->children().size(); ++i)
+ reserveScrollbarLayers(layer->children()[i].get(), clipLayer);
+
+ if (layer->drawsContent())
+ layer->setAlwaysReserveTextures(true);
+}
+
void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float pageScale, int layerAdjustX)
{
if (!scrollLayer())
@@ -105,6 +120,12 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
if (m_graphicsLayer->pageScaleFactor() != pageScale)
m_graphicsLayer->deviceOrPageScaleFactorChanged();
+
+ WebCore::LayerChromium* clipLayer = scrollLayer()->parent();
+ WebCore::LayerChromium* rootLayer = clipLayer;
+ while (rootLayer->parent())
+ rootLayer = rootLayer->parent();
+ reserveScrollbarLayers(rootLayer, clipLayer);
}
WebCore::LayerChromium* NonCompositedContentHost::scrollLayer()
@@ -150,12 +171,12 @@ void NonCompositedContentHost::setShowDebugBorders(bool showDebugBorders)
m_graphicsLayer->updateDebugIndicators();
}
-bool NonCompositedContentHost::showDebugBorders() const
+bool NonCompositedContentHost::showDebugBorders(const WebCore::GraphicsLayer*) const
{
return m_showDebugBorders;
}
-bool NonCompositedContentHost::showRepaintCounter() const
+bool NonCompositedContentHost::showRepaintCounter(const WebCore::GraphicsLayer*) const
{
return false;
}