Bug 539356 - Part 12 - Remove unnecessary LayerManagerLayerBuilder indirection. r=roc

This commit is contained in:
Matt Woodrow 2012-08-29 17:48:15 +12:00
parent 8acde25c22
commit 0725f91922
3 changed files with 3 additions and 26 deletions

View File

@ -87,20 +87,6 @@ public:
virtual ~LayerUserData() {}
};
class LayerManagerLayerBuilder : public LayerUserData {
public:
LayerManagerLayerBuilder(FrameLayerBuilder* aBuilder, bool aDelete = true)
: mLayerBuilder(aBuilder)
, mDelete(aDelete)
{
MOZ_COUNT_CTOR(LayerManagerLayerBuilder);
}
~LayerManagerLayerBuilder();
FrameLayerBuilder* mLayerBuilder;
bool mDelete;
};
/*
* Motivation: For truly smooth animation and video playback, we need to
* be able to compose frames and render them on a dedicated thread (i.e.
@ -213,8 +199,7 @@ public:
};
FrameLayerBuilder* GetLayerBuilder() {
LayerManagerLayerBuilder *data = static_cast<LayerManagerLayerBuilder*>(GetUserData(&gLayerManagerLayerBuilder));
return data ? data->mLayerBuilder : nullptr;
return reinterpret_cast<FrameLayerBuilder*>(GetUserData(&gLayerManagerLayerBuilder));
}
/**

View File

@ -644,7 +644,7 @@ FrameLayerBuilder::Init(nsDisplayListBuilder* aBuilder, LayerManager* aManager)
if (mRootPresContext) {
mInitialDOMGeneration = mRootPresContext->GetDOMGeneration();
}
aManager->SetUserData(&gLayerManagerLayerBuilder, new LayerManagerLayerBuilder(this));
aManager->SetUserData(&gLayerManagerLayerBuilder, this);
}
bool
@ -930,14 +930,6 @@ FrameLayerBuilder::RemoveDisplayItemDataForFrame(DisplayItemDataEntry* aEntry,
return PL_DHASH_REMOVE;
}
LayerManagerLayerBuilder::~LayerManagerLayerBuilder()
{
MOZ_COUNT_DTOR(LayerManagerLayerBuilder);
if (mDelete) {
delete mLayerBuilder;
}
}
/* static */ PLDHashOperator
FrameLayerBuilder::StoreNewDisplayItemData(DisplayItemDataEntry* aEntry,
void* aUserArg)

View File

@ -90,7 +90,7 @@ public:
* integer types (nsIntPoint/nsIntSize/nsIntRect/nsIntRegion) are all in layer
* coordinates, post-scaling, whereas appunit types are all pre-scaling.
*/
class FrameLayerBuilder {
class FrameLayerBuilder : public layers::LayerUserData {
public:
typedef layers::ContainerLayer ContainerLayer;
typedef layers::Layer Layer;