Add custom nsDisplayOwnLayer copy-constructor to fix refcounting
authorMiko Mynttinen <mikokm@gmail.com>
Mon, 15 May 2017 12:59:54 +0200
changeset 659482 a28b127aadf588ed58f946cce023b41654040219
parent 659481 76c03e87922c36dbc3a88249f9f89ee6c99a81bf
child 659483 35d46f26a1260a8297c3732d973d3f950c37af86
push id78143
push userbmo:ethlin@mozilla.com
push dateWed, 06 Sep 2017 04:00:32 +0000
milestone55.0a1
Add custom nsDisplayOwnLayer copy-constructor to fix refcounting
layout/painting/nsDisplayList.h
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -4213,16 +4213,26 @@ public:
                     uint32_t aFlags = 0,
                     ViewID aScrollTarget = mozilla::layers::FrameMetrics::NULL_SCROLL_ID,
                     float aScrollbarThumbRatio = 0.0f,
                     bool aForceActive = true);
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayOwnLayer();
 #endif
 
+  nsDisplayOwnLayer(const nsDisplayOwnLayer& aOther)
+    : nsDisplayWrapList(aOther)
+    , mFlags(aOther.mFlags)
+    , mScrollTarget(aOther.mFlags)
+    , mScrollbarThumbRatio(aOther.mScrollbarThumbRatio)
+    , mForceActive(aOther.mForceActive)
+  {
+    MOZ_COUNT_CTOR(nsDisplayOwnLayer);
+  }
+
   virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                              LayerManager* aManager,
                                              const ContainerLayerParameters& aContainerParameters) override;
   virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
                                    LayerManager* aManager,
                                    const ContainerLayerParameters& aParameters) override;
   virtual bool TryMerge(nsDisplayItem* aItem, bool aMerge) override
   {