Remote Layer Tree: Assertions during layer flushing after replaceSublayer()
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 18:55:22 +0000 (18:55 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 18:55:22 +0000 (18:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124194

Reviewed by Anders Carlsson.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::replaceSublayer):
Only remove the old layer from the children array once (via removeFromSuperlayer).
Update the superlayer backpointer on the new layer.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

index f76b1a9..4c7180e 100644 (file)
@@ -1,3 +1,15 @@
+2013-11-12  Tim Horton  <timothy_horton@apple.com>
+
+        Remote Layer Tree: Assertions during layer flushing after replaceSublayer()
+        https://bugs.webkit.org/show_bug.cgi?id=124194
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (PlatformCALayerRemote::replaceSublayer):
+        Only remove the old layer from the children array once (via removeFromSuperlayer).
+        Update the superlayer backpointer on the new layer.
+
 2013-11-12  Anders Carlsson  <andersca@apple.com>
 
         Add ImmutableArray::createStringArray
index 32a3f5b..8005d07 100644 (file)
@@ -233,8 +233,8 @@ void PlatformCALayerRemote::replaceSublayer(PlatformCALayer* reference, Platform
     size_t referenceIndex = m_children.find(reference);
     if (referenceIndex != notFound) {
         m_children[referenceIndex]->removeFromSuperlayer();
-        m_children.remove(referenceIndex);
         m_children.insert(referenceIndex, layer);
+        toPlatformCALayerRemote(layer)->m_superlayer = this;
     }
 
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);