Remove heap allocated clip chains option
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 27 Sep 2017 12:17:30 +1300
changeset 685663 6daa4fbafc4604803fb761761309af7e88911344
parent 685662 ed84fc37990d5fa09dec28aad7aca51f4a16d5c1
child 685664 648083cbbe77806f615802643bdf60481428799e
push id86010
push userbmo:ethlin@mozilla.com
push dateWed, 25 Oct 2017 00:44:42 +0000
milestone58.0a1
Remove heap allocated clip chains option
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1196,21 +1196,17 @@ nsDisplayListBuilder::~nsDisplayListBuil
   NS_ASSERTION(mPresShellStates.Length() == 0,
                "All presshells should have been exited");
   NS_ASSERTION(!mCurrentTableItem, "No table item should be active");
 
   for (nsDisplayItem* i : mTemporaryItems) {
     i->Destroy(this);
   }
   for (DisplayItemClipChain* c : mClipChainsToDestroy) {
-#ifdef USE_HEAP_ALLOCATED_CLIP_CHAINS
-    delete c;
-#else
      c->DisplayItemClipChain::~DisplayItemClipChain();
-#endif
   }
 
   MOZ_COUNT_DTOR(nsDisplayListBuilder);
 }
 
 uint32_t
 nsDisplayListBuilder::GetBackgroundPaintFlags() {
   uint32_t flags = 0;
@@ -1381,22 +1377,18 @@ nsDisplayListBuilder::FreeClipChains()
   // first which will drop the ref count on their ancestors.
   auto it = mClipChainsToDestroy.begin();
 
   while(it != mClipChainsToDestroy.end()) {
     DisplayItemClipChain* clip = *it;
 
     if (!clip->mRefCount) {
       it = mClipChainsToDestroy.erase(it);
-#ifdef USE_HEAP_ALLOCATED_CLIP_CHAINS
-      delete clip;
-#else
       clip->DisplayItemClipChain::~DisplayItemClipChain();
       Destroy(DisplayItemType::TYPE_ZERO, clip);
-#endif
     } else {
       ++it;
     }
   }
 }
 
 void
 nsDisplayListBuilder::ResetMarkedFramesForDisplayList()
@@ -1527,22 +1519,18 @@ nsDisplayListBuilder::AllocateActiveScro
   return asr;
 }
 
 const DisplayItemClipChain*
 nsDisplayListBuilder::AllocateDisplayItemClipChain(const DisplayItemClip& aClip,
                                                    const ActiveScrolledRoot* aASR,
                                                    const DisplayItemClipChain* aParent)
 {
-#ifdef USE_HEAP_ALLOCATED_CLIP_CHAINS
-  DisplayItemClipChain* c = new DisplayItemClipChain(aClip, aASR, aParent);
-#else
   void* p = Allocate(sizeof(DisplayItemClipChain), DisplayItemType::TYPE_ZERO);
   DisplayItemClipChain* c = new (KnownNotNull, p) DisplayItemClipChain(aClip, aASR, aParent);
-#endif
   mClipChainsToDestroy.emplace_front(c);
   return c;
 }
 
 struct ClipChainItem {
   DisplayItemClip clip;
   const ActiveScrolledRoot* asr;
 };
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -45,17 +45,16 @@
 #include "nsTHashtable.h"
 
 #include <stdlib.h>
 #include <algorithm>
 #include <list>
 
 
 //#define USE_PRES_ARENA_ALLOCATOR 1
-//#define USE_HEAP_ALLOCATED_CLIP_CHAINS 1
 //#define USE_POW2_ARENA_BUCKETS 1
 
 class gfxContext;
 class nsIContent;
 class nsDisplayList;
 class nsDisplayTableItem;
 class nsISelection;
 class nsIScrollableFrame;