[chromium] Don't crash if tile upload happens without painting first
[WebKit-https.git] / Source / WebCore / platform / graphics / chromium / TiledLayerChromium.cpp
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;