2011-02-05 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Feb 2011 05:24:27 +0000 (05:24 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Feb 2011 05:24:27 +0000 (05:24 +0000)
        Reviewed by Dan Bernstein.

        REGRESSION: New drawing area is causing some WebProcess crashes in layout tests
        https://bugs.webkit.org/show_bug.cgi?id=53865
        <rdar://problem/8963148>

        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Handle the case
        where this is called repeatedly without exiting accelerated composting mode
        first.
        (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Handle the case
        of being called more than once.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

index 41ebb56..eb38f75 100644 (file)
@@ -1,3 +1,18 @@
+2011-02-05  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION: New drawing area is causing some WebProcess crashes in layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=53865
+        <rdar://problem/8963148>
+        
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Handle the case
+        where this is called repeatedly without exiting accelerated composting mode
+        first.
+        (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Handle the case
+        of being called more than once.
+
 2011-02-05  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler.
index dd840b7..2fe8949 100644 (file)
@@ -234,7 +234,8 @@ void DrawingAreaImpl::resumePainting()
 
 void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLayer)
 {
-    ASSERT(!m_layerTreeHost);
+    if (m_layerTreeHost)
+        m_layerTreeHost->invalidate();
 
     m_layerTreeHost = LayerTreeHost::create(m_webPage, graphicsLayer);
     
@@ -251,9 +252,11 @@ void DrawingAreaImpl::enterAcceleratedCompositingMode(GraphicsLayer* graphicsLay
 
 void DrawingAreaImpl::exitAcceleratedCompositingMode()
 {
-    m_layerTreeHost->invalidate();
-    m_layerTreeHost = nullptr;
-    
+    if (m_layerTreeHost) {
+        m_layerTreeHost->invalidate();
+        m_layerTreeHost = nullptr;
+    }
+
     if (m_inSetSize)
         return;