Title: [198416] branches/safari-601.1.46-branch/Source/WebCore

Diff

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (198415 => 198416)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-03-18 15:51:15 UTC (rev 198415)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-03-18 15:59:07 UTC (rev 198416)
@@ -1,3 +1,24 @@
+2016-03-18  Babak Shafiei  <[email protected]>
+
+        Merge r192853.
+
+    2015-11-30  Simon Fraser  <[email protected]>
+
+            Fix possible crash with animated layers in reflections
+            https://bugs.webkit.org/show_bug.cgi?id=151689
+            rdar://problem/23018612
+
+            Reviewed by Darin Adler.
+
+            Reflections create additional PlatformCALayers whose owner is set to the GraphicsLayerCA.
+            Those PlatformCALayers need their owner pointer cleared out when the GraphicsLayerCA
+            is destroyed.
+
+            Tested by compositing/reflections/nested-reflection-transition.html
+
+            * platform/graphics/ca/GraphicsLayerCA.cpp:
+            * platform/graphics/ca/GraphicsLayerCA.h:
+
 2016-03-14  Matthew Hanson  <[email protected]>
 
         Merge r197125. rdar://problem/24860685

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (198415 => 198416)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-03-18 15:51:15 UTC (rev 198415)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-03-18 15:59:07 UTC (rev 198416)
@@ -3487,14 +3487,25 @@
     shapeMaskLayer = findOrMakeClone(cloneID, m_shapeMaskLayer.get(), m_shapeMaskLayerClones.get(), cloneLevel);
 }
 
+void GraphicsLayerCA::clearClones(std::unique_ptr<LayerMap>& layerMap)
+{
+    if (!layerMap)
+        return;
+
+    for (auto& layer : layerMap->values())
+        layer->setOwner(nullptr);
+    
+    layerMap = nullptr;
+}
+
 void GraphicsLayerCA::removeCloneLayers()
 {
-    m_layerClones = nullptr;
-    m_structuralLayerClones = nullptr;
-    m_contentsLayerClones = nullptr;
-    m_contentsClippingLayerClones = nullptr;
-    m_contentsShapeMaskLayerClones = nullptr;
-    m_shapeMaskLayerClones = nullptr;
+    clearClones(m_layerClones);
+    clearClones(m_structuralLayerClones);
+    clearClones(m_contentsLayerClones);
+    clearClones(m_contentsClippingLayerClones);
+    clearClones(m_contentsShapeMaskLayerClones);
+    clearClones(m_shapeMaskLayerClones);
 }
 
 FloatPoint GraphicsLayerCA::positionForCloneRootLayer() const

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (198415 => 198416)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2016-03-18 15:51:15 UTC (rev 198415)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2016-03-18 15:59:07 UTC (rev 198416)
@@ -367,6 +367,8 @@
     void ensureCloneLayers(CloneID, RefPtr<PlatformCALayer>& primaryLayer, RefPtr<PlatformCALayer>& structuralLayer,
         RefPtr<PlatformCALayer>& contentsLayer, RefPtr<PlatformCALayer>& contentsClippingLayer, RefPtr<PlatformCALayer>& contentsShapeMaskLayer, RefPtr<PlatformCALayer>& shapeMaskLayer, CloneLevel);
 
+    static void clearClones(std::unique_ptr<LayerMap>&);
+
     bool hasCloneLayers() const { return !!m_layerClones; }
     void removeCloneLayers();
     FloatPoint positionForCloneRootLayer() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to