[chromium] Don't ever skip drawing the non-composited content layer
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 23:23:51 +0000 (23:23 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 23:23:51 +0000 (23:23 +0000)
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
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp

index 17fea18..ecc4372 100644 (file)
@@ -1,3 +1,23 @@
+2012-01-27  Adrienne Walker  <enne@google.com>
+
+        [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  <mrobinson@igalia.com>
 
         Fix a warning in the GTK+ build.
index f2e3122..271858e 100644 (file)
@@ -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;
index 8b8622b..92637fc 100644 (file)
@@ -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
index 344d742..f111774 100644 (file)
@@ -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;
index c667e6f..83fdae4 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-27  Adrienne Walker  <enne@google.com>
+
+        [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  <fsamuel@chromium.org>
 
         Rename shouldLayoutFixedElementsRelativeToFrame and make it a setting
index 7fcc4e3..d5a8ba8 100644 (file)
@@ -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);