From dc4679c6618ebb42a3b99b7c3f77173284a0a079 Mon Sep 17 00:00:00 2001 From: "enne@google.com" Date: Fri, 27 Jan 2012 23:23:51 +0000 Subject: [PATCH] [chromium] Don't ever skip drawing the non-composited content layer https://bugs.webkit.org/show_bug.cgi?id=77236 Reviewed by James Robinson. Source/WebCore: Since the root layer has its textures potentially reserved last in a front-to-back iteration, don't ever skip drawing it if we can't reserve its textures. Instead, checkerboard and draw background color quads instead to fill the viewport. This behavior is tied to the backgroundFillsViewport setting. * platform/graphics/chromium/TiledLayerChromium.cpp: (WebCore::TiledLayerChromium::prepareToUpdateTiles): * platform/graphics/chromium/cc/CCLayerTilingData.cpp: (WebCore::CCLayerTilingData::reset): * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: (WebCore::CCTiledLayerImpl::appendQuads): Source/WebKit/chromium: This is a tiny fix. If the non-composited content layer never gets painted, then the background color never gets set and it is just opaque black. * src/WebViewImpl.cpp: (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106160 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 20 ++++++++++++++++++++ .../graphics/chromium/TiledLayerChromium.cpp | 5 ++++- .../graphics/chromium/cc/CCLayerTilingData.cpp | 1 - .../graphics/chromium/cc/CCTiledLayerImpl.cpp | 2 +- Source/WebKit/chromium/ChangeLog | 14 ++++++++++++++ Source/WebKit/chromium/src/WebViewImpl.cpp | 4 ++++ 6 files changed, 43 insertions(+), 3 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 17fea18..ecc4372 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,23 @@ +2012-01-27 Adrienne Walker + + [chromium] Don't ever skip drawing the non-composited content layer + https://bugs.webkit.org/show_bug.cgi?id=77236 + + Reviewed by James Robinson. + + Since the root layer has its textures potentially reserved last in a + front-to-back iteration, don't ever skip drawing it if we can't + reserve its textures. Instead, checkerboard and draw background color + quads instead to fill the viewport. This behavior is tied to the + backgroundFillsViewport setting. + + * platform/graphics/chromium/TiledLayerChromium.cpp: + (WebCore::TiledLayerChromium::prepareToUpdateTiles): + * platform/graphics/chromium/cc/CCLayerTilingData.cpp: + (WebCore::CCLayerTilingData::reset): + * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: + (WebCore::CCTiledLayerImpl::appendQuads): + 2012-01-27 Martin Robinson Fix a warning in the GTK+ build. diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp index f2e3122..271858e 100644 --- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp @@ -392,7 +392,10 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int if (!tile->managedTexture()->reserve(m_tiler->tileSize(), m_textureFormat)) { m_skipsIdlePaint = true; if (!idle) { - m_skipsDraw = true; + // If the background covers the viewport, always draw this + // layer so that checkerboarded tiles will still draw. + if (!backgroundCoversViewport()) + m_skipsDraw = true; cleanupResources(); } return; diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp index 8b8622b..92637fc 100644 --- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp +++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp @@ -96,7 +96,6 @@ CCLayerTilingData::Tile* CCLayerTilingData::tileAt(int i, int j) const void CCLayerTilingData::reset() { m_tiles.clear(); - m_tilingData.setTotalSize(0, 0); } void CCLayerTilingData::layerRectToTileIndices(const IntRect& layerRect, int& left, int& top, int& right, int& bottom) const diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp index 344d742..f111774 100644 --- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp +++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp @@ -127,7 +127,7 @@ void CCTiledLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState appendGutterQuads(quadList, sharedQuadState); - if (!m_tiler || m_tiler->isEmpty() || layerRect.isEmpty()) + if (!m_tiler || !m_tiler->numTiles() || layerRect.isEmpty()) return; int left, top, right, bottom; diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index c667e6f..83fdae4 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,17 @@ +2012-01-27 Adrienne Walker + + [chromium] Don't ever skip drawing the non-composited content layer + https://bugs.webkit.org/show_bug.cgi?id=77236 + + Reviewed by James Robinson. + + This is a tiny fix. If the non-composited content layer never gets + painted, then the background color never gets set and it is just + opaque black. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + 2012-01-27 Fady Samuel Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 7fcc4e3..d5a8ba8 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -3009,6 +3009,10 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this)); m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); + + if (page() && page()->mainFrame()->view()) + m_nonCompositedContentHost->setBackgroundColor(page()->mainFrame()->view()->documentBackgroundColor()); + m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings); if (m_layerTreeHost) { m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers); -- 2.7.4