diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
| commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
| tree | f6256640b6c46d7da221435803cae65326817ba2 /Source/WebKit/chromium/src/NonCompositedContentHost.cpp | |
| parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
| download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz | |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Source/WebKit/chromium/src/NonCompositedContentHost.cpp')
| -rw-r--r-- | Source/WebKit/chromium/src/NonCompositedContentHost.cpp | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index fb9c12de6..4df4204b3 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -30,6 +30,7 @@ #include "FloatPoint.h" #include "FloatRect.h" #include "GraphicsLayer.h" +#include "GraphicsLayerChromium.h" #include "PlatformContextSkia.h" #include "WebViewImpl.h" #include <public/WebContentLayer.h> @@ -48,11 +49,11 @@ NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView) m_graphicsLayer->setName("non-composited content"); #endif m_graphicsLayer->setDrawsContent(true); - WebContentLayer layer = m_graphicsLayer->platformLayer()->to<WebContentLayer>(); - layer.setUseLCDText(true); - layer.setOpaque(true); + WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChromium*>(m_graphicsLayer.get())->contentLayer(); + layer->setUseLCDText(true); + layer->layer()->setOpaque(true); #if !OS(ANDROID) - layer.setDrawCheckerboardForMissingTiles(true); + layer->setDrawCheckerboardForMissingTiles(true); #endif } @@ -80,27 +81,13 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer) return; } - if (*layer->platformLayer() == scrollLayer()) + if (layer->platformLayer() == scrollLayer()) return; layer->addChildAtIndex(m_graphicsLayer.get(), 0); ASSERT(haveScrollLayer()); } -static void reserveScrollbarLayers(WebLayer layer, WebLayer 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.numberOfChildren(); ++i) - reserveScrollbarLayers(layer.childAt(i), clipLayer); - - if (layer.drawsContent()) - layer.setAlwaysReserveTextures(true); -} - void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, float deviceScale) { if (!haveScrollLayer()) @@ -109,12 +96,12 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, bool visibleRectChanged = m_viewportSize != viewportSize; m_viewportSize = viewportSize; - WebScrollableLayer layer = scrollLayer(); - layer.setScrollPosition(scrollPosition + scrollOrigin); - layer.setPosition(WebFloatPoint(-scrollPosition)); + WebLayer* layer = scrollLayer(); + layer->setScrollPosition(scrollPosition + scrollOrigin); + layer->setPosition(WebFloatPoint(-scrollPosition)); // Due to the possibility of pinch zoom, the noncomposited layer is always // assumed to be scrollable. - layer.setScrollable(true); + layer->setScrollable(true); m_deviceScaleFactor = deviceScale; m_graphicsLayer->deviceOrPageScaleFactorChanged(); m_graphicsLayer->setSize(contentsSize); @@ -134,12 +121,6 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, m_graphicsLayer->setNeedsDisplay(); } else if (visibleRectChanged) m_graphicsLayer->setNeedsDisplay(); - - WebLayer clipLayer = layer.parent(); - WebLayer rootLayer = clipLayer; - while (!rootLayer.parent().isNull()) - rootLayer = rootLayer.parent(); - reserveScrollbarLayers(rootLayer, clipLayer); } bool NonCompositedContentHost::haveScrollLayer() @@ -147,11 +128,11 @@ bool NonCompositedContentHost::haveScrollLayer() return m_graphicsLayer->parent(); } -WebScrollableLayer NonCompositedContentHost::scrollLayer() +WebLayer* NonCompositedContentHost::scrollLayer() { if (!m_graphicsLayer->parent()) - return WebScrollableLayer(); - return m_graphicsLayer->parent()->platformLayer()->to<WebScrollableLayer>(); + return 0; + return m_graphicsLayer->parent()->platformLayer(); } void NonCompositedContentHost::invalidateRect(const WebCore::IntRect& rect) |
