Chromium Code Reviews| Index: Source/WebKit/chromium/src/WebViewImpl.cpp |
| diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp |
| index 485f9eaac58f49162a78070a1578d977ecd76137..8267dff3a5bf034fd0b747238bec3bebd7b9884e 100644 |
| --- a/Source/WebKit/chromium/src/WebViewImpl.cpp |
| +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp |
| @@ -59,7 +59,6 @@ |
| #include "GraphicsLayerFactoryChromium.h" |
| #include "HTMLNames.h" |
| #include "LinkHighlight.h" |
| -#include "NonCompositedContentHost.h" |
| #include "PageWidgetDelegate.h" |
| #include "PrerendererClientImpl.h" |
| #include "SpeechInputClientImpl.h" |
| @@ -1770,6 +1769,8 @@ void WebViewImpl::layout() |
| { |
| TRACE_EVENT0("webkit", "WebViewImpl::layout"); |
| PageWidgetDelegate::layout(m_page.get()); |
| + if (m_layerTreeView) |
| + m_layerTreeView->setBackgroundColor(backgroundColor()); |
| if (m_linkHighlight) |
| m_linkHighlight->updateGeometry(); |
| @@ -2913,8 +2914,7 @@ void WebViewImpl::enableFixedLayoutMode(bool enable) |
| frame->view()->setUseFixedLayout(enable); |
| - // Also notify the base layer, which RenderLayerCompositor does not see. |
| - if (m_nonCompositedContentHost) |
| + if (m_isAcceleratedCompositingActive) |
| updateLayerTreeViewport(); |
| } |
| @@ -3518,9 +3518,6 @@ void WebViewImpl::setIsTransparent(bool isTransparent) |
| // Future frames check this to know whether to be transparent. |
| m_isTransparent = isTransparent; |
| - |
| - if (m_nonCompositedContentHost) |
| - m_nonCompositedContentHost->setOpaque(!isTransparent); |
| } |
| bool WebViewImpl::isTransparent() const |
| @@ -3615,6 +3612,14 @@ void WebViewImpl::layoutUpdated(WebFrameImpl* webframe) |
| if (!m_client || webframe != mainFrameImpl()) |
| return; |
| + if (m_layerTreeViewCommitsDeferred) { |
| + // If we receive an invalidation from WebKit while in deferred commit mode, |
|
jamesr
2013/05/28 18:27:50
update the comment since this function isn't about
|
| + // that means it's time to start producing frames again so un-defer. |
| + if (m_layerTreeView) |
| + m_layerTreeView->setDeferCommits(false); |
| + m_layerTreeViewCommitsDeferred = false; |
| + } |
| + |
| if (m_shouldAutoResize && mainFrameImpl()->frame() && mainFrameImpl()->frame()->view()) { |
| WebSize frameSize = mainFrameImpl()->frame()->view()->frameRect().size(); |
| if (frameSize != m_size) { |
| @@ -3807,16 +3812,6 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer) |
| m_rootLayer = layer ? layer->platformLayer() : 0; |
| setIsAcceleratedCompositingActive(layer); |
| - if (m_nonCompositedContentHost) { |
| - GraphicsLayer* scrollLayer = 0; |
| - if (layer) { |
| - Document* document = page()->mainFrame()->document(); |
| - RenderView* renderView = document->renderView(); |
| - RenderLayerCompositor* compositor = renderView->compositor(); |
| - scrollLayer = compositor->scrollLayer(); |
| - } |
| - m_nonCompositedContentHost->setScrollLayer(scrollLayer); |
| - } |
| if (m_layerTreeView) { |
| if (m_rootLayer) |
| @@ -3840,40 +3835,13 @@ void WebViewImpl::scrollRootLayerRect(const IntSize&, const IntRect&) |
| void WebViewImpl::invalidateRect(const IntRect& rect) |
| { |
| - if (m_layerTreeViewCommitsDeferred) { |
| - // If we receive an invalidation from WebKit while in deferred commit mode, |
| - // that means it's time to start producing frames again so un-defer. |
| - if (m_layerTreeView) |
| - m_layerTreeView->setDeferCommits(false); |
| - m_layerTreeViewCommitsDeferred = false; |
| - } |
| if (m_isAcceleratedCompositingActive) { |
| ASSERT(m_layerTreeView); |
| - |
| - if (!page()) |
| - return; |
| - |
| - FrameView* view = page()->mainFrame()->view(); |
| - IntRect dirtyRect = view->windowToContents(rect); |
| updateLayerTreeViewport(); |
| - m_nonCompositedContentHost->invalidateRect(dirtyRect); |
| } else if (m_client) |
| m_client->didInvalidateRect(rect); |
| } |
| -NonCompositedContentHost* WebViewImpl::nonCompositedContentHost() |
| -{ |
| - return m_nonCompositedContentHost.get(); |
| -} |
| - |
| -void WebViewImpl::setBackgroundColor(const WebCore::Color& color) |
| -{ |
| - WebCore::Color documentBackgroundColor = color.isValid() ? color : WebCore::Color::white; |
| - WebColor webDocumentBackgroundColor = documentBackgroundColor.rgb(); |
| - m_nonCompositedContentHost->setBackgroundColor(documentBackgroundColor); |
| - m_layerTreeView->setBackgroundColor(webDocumentBackgroundColor); |
| -} |
| - |
| WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const |
| { |
| return m_graphicsLayerFactory.get(); |
| @@ -3902,22 +3870,6 @@ void WebViewImpl::scheduleAnimation() |
| m_client->scheduleAnimation(); |
| } |
| -void WebViewImpl::paintRootLayer(GraphicsContext& context, const IntRect& contentRect) |
| -{ |
| - double paintStart = currentTime(); |
| - if (!page()) |
| - return; |
| - FrameView* view = page()->mainFrame()->view(); |
| - context.setUseHighResMarkers(page()->deviceScaleFactor() > 1.5f); |
| - view->paintContents(&context, contentRect); |
| - double paintEnd = currentTime(); |
| - double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart); |
| - WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelRootPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); |
| - WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelRootPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); |
| - |
| - setBackgroundColor(view->documentBackgroundColor()); |
| -} |
| - |
| void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
| { |
| WebKit::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompositingActive", active * 2 + m_isAcceleratedCompositingActive, 4); |
| @@ -3950,10 +3902,6 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
| } else { |
| TRACE_EVENT0("webkit", "WebViewImpl::setIsAcceleratedCompositingActive(true)"); |
| - m_nonCompositedContentHost = NonCompositedContentHost::create(this, graphicsLayerFactory()); |
| - m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); |
| - m_nonCompositedContentHost->setOpaque(!isTransparent()); |
| - |
| m_client->initializeLayerTreeView(); |
| m_layerTreeView = m_client->layerTreeView(); |
| if (m_layerTreeView) { |
| @@ -3963,6 +3911,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
| m_layerTreeView->setVisible(visible); |
| m_layerTreeView->setDeviceScaleFactor(page()->deviceScaleFactor()); |
| m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageScaleFactor(), maximumPageScaleFactor()); |
| + m_layerTreeView->setBackgroundColor(backgroundColor()); |
| m_layerTreeView->setHasTransparentBackground(isTransparent()); |
| updateLayerTreeViewport(); |
| m_client->didActivateCompositor(m_inputHandlerIdentifier); |
| @@ -3975,7 +3924,6 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
| m_layerTreeView->setShowDebugBorders(m_showDebugBorders); |
| m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnabled); |
| } else { |
| - m_nonCompositedContentHost.clear(); |
| m_isAcceleratedCompositingActive = false; |
| m_client->didDeactivateCompositor(); |
| m_compositorCreationFailed = true; |
| @@ -4046,11 +3994,9 @@ void WebViewImpl::didExitCompositingMode() |
| void WebViewImpl::updateLayerTreeViewport() |
| { |
| - if (!page() || !m_nonCompositedContentHost || !m_layerTreeView) |
| + if (!page() || !m_layerTreeView) |
| return; |
| - FrameView* view = page()->mainFrame()->view(); |
| - m_nonCompositedContentHost->setViewport(m_size, view->contentsSize(), view->scrollPosition(), view->scrollOrigin()); |
| m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageScaleFactor(), maximumPageScaleFactor()); |
| } |