[chromium] Don't crash if tile upload happens without painting first
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 22:26:27 +0000 (22:26 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 22:26:27 +0000 (22:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73939

Reviewed by James Robinson.

Remove at least one place (in ImageLayerChromium) where this could
happen.

Although this shouldn't happen, we should be robust to it in the
chance that other code causes it to.

* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateCompositorResources):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

index 8e830c5..d02e6b3 100644 (file)
@@ -1,3 +1,21 @@
+2011-12-06  Adrienne Walker  <enne@google.com>
+
+        [chromium] Don't crash if tile upload happens without painting first
+        https://bugs.webkit.org/show_bug.cgi?id=73939
+
+        Reviewed by James Robinson.
+
+        Remove at least one place (in ImageLayerChromium) where this could
+        happen.
+
+        Although this shouldn't happen, we should be robust to it in the
+        chance that other code causes it to.
+
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerChromium::paintContentsIfDirty):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::updateCompositorResources):
+
 2011-12-06  Ruben  <chromium@hybridsource.org>
 
         Enable web audio by default on non-Mac POSIX platforms
index 4eb65d4..4fb9574 100644 (file)
@@ -178,9 +178,6 @@ void ImageLayerChromium::paintContentsIfDirty()
         }
     }
 
-    if (visibleLayerRect().isEmpty())
-        return;
-
     prepareToUpdate(visibleLayerRect());
 }
 
index 968d9e3..5c55f59 100644 (file)
@@ -174,8 +174,12 @@ void TiledLayerChromium::createTiler(CCLayerTilingData::BorderTexelOption border
 
 void TiledLayerChromium::updateCompositorResources(GraphicsContext3D*, CCTextureUpdater& updater)
 {
+    // If this assert is hit, it means that paintContentsIfDirty hasn't been
+    // called on this layer. Any layer that is updated should be painted first.
+    ASSERT(m_tiler);
+
     // Painting could cause compositing to get turned off, which may cause the tiler to become invalidated mid-update.
-    if (m_skipsDraw || m_requestedUpdateRect.isEmpty() || !m_tiler->numTiles())
+    if (m_skipsDraw || m_requestedUpdateRect.isEmpty() || !m_tiler || !m_tiler->numTiles())
         return;
 
     int left, top, right, bottom;