Bug 1217662 - part 5 - move FrameLayerBuilder and helper classes's ctors/dtors out-of-line; r=mattwoodrow

This change means that we don't have to have the definition of
LayerManager visible when FrameLayerBuilder is declared (which would be
necessary for, e.g. the ctor/dtor of ClippedDisplayItem), which means we
can get rid of the Layers.h include here in a subsequent patch.
This commit is contained in:
Nathan Froyd 2015-10-22 17:00:16 -04:00
parent bafc36afa2
commit caa300f385
2 changed files with 50 additions and 32 deletions

View File

@ -88,6 +88,22 @@ uint8_t gLayerManagerUserData;
*/
uint8_t gMaskLayerUserData;
FrameLayerBuilder::FrameLayerBuilder()
: mRetainingManager(nullptr)
, mDetectedDOMModification(false)
, mInvalidateAllLayers(false)
, mInLayerTreeCompressionMode(false)
, mContainerLayerGeneration(0)
, mMaxContainerLayerGeneration(0)
{
MOZ_COUNT_CTOR(FrameLayerBuilder);
}
FrameLayerBuilder::~FrameLayerBuilder()
{
MOZ_COUNT_DTOR(FrameLayerBuilder);
}
FrameLayerBuilder::DisplayItemData::DisplayItemData(LayerManagerData* aParent, uint32_t aKey,
Layer* aLayer, nsIFrame* aFrame)
@ -4572,6 +4588,13 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame,
lmd->mDisplayItems.PutEntry(data);
}
FrameLayerBuilder::ClippedDisplayItem::ClippedDisplayItem(nsDisplayItem* aItem,
uint32_t aGeneration)
: mItem(aItem)
, mContainerLayerGeneration(aGeneration)
{
}
FrameLayerBuilder::ClippedDisplayItem::~ClippedDisplayItem()
{
if (mInactiveLayerManager) {
@ -4579,6 +4602,27 @@ FrameLayerBuilder::ClippedDisplayItem::~ClippedDisplayItem()
}
}
FrameLayerBuilder::PaintedLayerItemsEntry::PaintedLayerItemsEntry(const PaintedLayer *aKey)
: nsPtrHashKey<PaintedLayer>(aKey)
, mContainerLayerFrame(nullptr)
, mLastCommonClipCount(0)
, mContainerLayerGeneration(0)
, mHasExplicitLastPaintOffset(false)
, mCommonClipCount(0)
{
}
FrameLayerBuilder::PaintedLayerItemsEntry::PaintedLayerItemsEntry(const PaintedLayerItemsEntry& aOther)
: nsPtrHashKey<PaintedLayer>(aOther.mKey)
, mItems(aOther.mItems)
{
NS_ERROR("Should never be called, since we ALLOW_MEMMOVE");
}
FrameLayerBuilder::PaintedLayerItemsEntry::~PaintedLayerItemsEntry()
{
}
void
FrameLayerBuilder::AddLayerDisplayItem(Layer* aLayer,
nsDisplayItem* aItem,

View File

@ -173,20 +173,8 @@ public:
typedef layers::BasicLayerManager BasicLayerManager;
typedef layers::EventRegions EventRegions;
FrameLayerBuilder() :
mRetainingManager(nullptr),
mDetectedDOMModification(false),
mInvalidateAllLayers(false),
mInLayerTreeCompressionMode(false),
mContainerLayerGeneration(0),
mMaxContainerLayerGeneration(0)
{
MOZ_COUNT_CTOR(FrameLayerBuilder);
}
~FrameLayerBuilder()
{
MOZ_COUNT_DTOR(FrameLayerBuilder);
}
FrameLayerBuilder();
~FrameLayerBuilder();
static void Shutdown();
@ -579,11 +567,7 @@ protected:
* PaintedLayer.
*/
struct ClippedDisplayItem {
ClippedDisplayItem(nsDisplayItem* aItem, uint32_t aGeneration)
: mItem(aItem), mContainerLayerGeneration(aGeneration)
{
}
ClippedDisplayItem(nsDisplayItem* aItem, uint32_t aGeneration);
~ClippedDisplayItem();
nsDisplayItem* mItem;
@ -624,19 +608,9 @@ protected:
public:
class PaintedLayerItemsEntry : public nsPtrHashKey<PaintedLayer> {
public:
explicit PaintedLayerItemsEntry(const PaintedLayer *key)
: nsPtrHashKey<PaintedLayer>(key)
, mContainerLayerFrame(nullptr)
, mLastCommonClipCount(0)
, mContainerLayerGeneration(0)
, mHasExplicitLastPaintOffset(false)
, mCommonClipCount(0)
{}
PaintedLayerItemsEntry(const PaintedLayerItemsEntry &toCopy) :
nsPtrHashKey<PaintedLayer>(toCopy.mKey), mItems(toCopy.mItems)
{
NS_ERROR("Should never be called, since we ALLOW_MEMMOVE");
}
explicit PaintedLayerItemsEntry(const PaintedLayer *key);
PaintedLayerItemsEntry(const PaintedLayerItemsEntry&);
~PaintedLayerItemsEntry();
nsTArray<ClippedDisplayItem> mItems;
nsIFrame* mContainerLayerFrame;