Bug 946958 part 2. Remove methods which just forward to compositor. r=mattwoodrow

This commit is contained in:
Nicholas Cameron 2013-12-09 14:40:59 +13:00
parent 67f3ec8830
commit c9131de1bb
7 changed files with 15 additions and 56 deletions

View File

@ -133,15 +133,6 @@ LayerManager::CreateDrawTarget(const IntSize &aSize,
CreateOffscreenCanvasDrawTarget(aSize, aFormat);
}
TextureFactoryIdentifier
LayerManager::GetTextureFactoryIdentifier()
{
//TODO[nrc] make pure virtual when all layer managers use Compositor
NS_ERROR("Should have been overridden");
return TextureFactoryIdentifier();
}
#ifdef DEBUG
void
LayerManager::Mutated(Layer* aLayer)

View File

@ -437,12 +437,6 @@ public:
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) { return true; }
/**
* Returns a TextureFactoryIdentifier which describes properties of the backend
* used to decide what kind of texture and buffer clients to create
*/
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier();
/**
* returns the maximum texture size on this layer backend, or INT32_MAX
* if there is no maximum

View File

@ -73,7 +73,7 @@ public:
virtual already_AddRefed<ColorLayer> CreateColorLayer();
virtual already_AddRefed<RefLayer> CreateRefLayer();
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE
TextureFactoryIdentifier GetTextureFactoryIdentifier()
{
return mForwarder->GetTextureFactoryIdentifier();
}

View File

@ -786,19 +786,6 @@ LayerComposite::Destroy()
}
}
void
LayerManagerComposite::SetCompositorID(uint32_t aID)
{
NS_ASSERTION(mCompositor, "No compositor");
mCompositor->SetCompositorID(aID);
}
void
LayerManagerComposite::NotifyShadowTreeTransaction()
{
mCompositor->NotifyLayersTransaction();
}
bool
LayerManagerComposite::CanUseCanvasLayerForSize(const gfxIntSize &aSize)
{
@ -806,18 +793,6 @@ LayerManagerComposite::CanUseCanvasLayerForSize(const gfxIntSize &aSize)
aSize.height));
}
TextureFactoryIdentifier
LayerManagerComposite::GetTextureFactoryIdentifier()
{
return mCompositor->GetTextureFactoryIdentifier();
}
int32_t
LayerManagerComposite::GetMaxTextureSize() const
{
return mCompositor->GetMaxTextureSize();
}
#ifndef MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS
/*static*/ bool

View File

@ -110,8 +110,6 @@ public:
}
void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget);
void NotifyShadowTreeTransaction();
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData,
@ -119,11 +117,14 @@ public:
virtual void SetRoot(Layer* aLayer) MOZ_OVERRIDE { mRoot = aLayer; }
// XXX[nrc]: never called, we should move this logic to ClientLayerManager
// (bug 946926).
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE;
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE;
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE;
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE
{
MOZ_CRASH("Call on compositor, not LayerManagerComposite");
}
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
@ -145,8 +146,7 @@ public:
}
virtual void GetBackendName(nsAString& name) MOZ_OVERRIDE
{
MOZ_ASSERT(false, "Shouldn't be called for composited layer manager");
name.AssignLiteral("Composite");
MOZ_CRASH("Shouldn't be called for composited layer manager");
}
virtual already_AddRefed<gfxASurface>
@ -215,8 +215,6 @@ public:
static void PlatformSyncBeforeReplyUpdate();
void SetCompositorID(uint32_t aID);
void AddInvalidRegion(const nsIntRegion& aRegion)
{
mInvalidRegion.Or(mInvalidRegion, aRegion);

View File

@ -509,7 +509,7 @@ CompositorParent::NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint)
AutoResolveRefLayers resolve(mCompositionManager);
mApzcTreeManager->UpdatePanZoomControllerTree(this, mLayerManager->GetRoot(), aIsFirstPaint, aId);
mLayerManager->NotifyShadowTreeTransaction();
mCompositor->NotifyLayersTransaction();
}
ScheduleComposition();
}
@ -703,7 +703,7 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
}
}
ScheduleComposition();
mLayerManager->NotifyShadowTreeTransaction();
mCompositor->NotifyLayersTransaction();
}
void
@ -730,8 +730,8 @@ CompositorParent::InitializeLayerManager(const nsTArray<LayersBackend>& aBackend
MOZ_ASSERT(compositor, "Passed invalid backend hint");
compositor->SetCompositorID(mCompositorID);
RefPtr<LayerManagerComposite> layerManager = new LayerManagerComposite(compositor);
layerManager->SetCompositorID(mCompositorID);
if (layerManager->Initialize()) {
mLayerManager = layerManager;
@ -769,7 +769,7 @@ CompositorParent::AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aB
mCompositionManager = new AsyncCompositionManager(mLayerManager);
*aSuccess = true;
*aTextureFactoryIdentifier = mLayerManager->GetTextureFactoryIdentifier();
*aTextureFactoryIdentifier = mCompositor->GetTextureFactoryIdentifier();
LayerTransactionParent* p = new LayerTransactionParent(mLayerManager, this, 0);
p->AddIPDLReference();
return p;
@ -1078,7 +1078,7 @@ CrossProcessCompositorParent::AllocPLayerTransactionParent(const nsTArray<Layers
if (sIndirectLayerTrees[aId].mLayerManager) {
LayerManagerComposite* lm = sIndirectLayerTrees[aId].mLayerManager;
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
*aTextureFactoryIdentifier = lm->GetCompositor()->GetTextureFactoryIdentifier();
*aSuccess = true;
LayerTransactionParent* p = new LayerTransactionParent(lm, this, aId);
p->AddIPDLReference();

View File

@ -647,7 +647,8 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
// Perhaps the document containing this frame currently has no presentation?
if (lm && lm->GetBackendType() == LAYERS_CLIENT) {
*aTextureFactoryIdentifier = lm->GetTextureFactoryIdentifier();
*aTextureFactoryIdentifier =
static_cast<ClientLayerManager*>(lm.get())->GetTextureFactoryIdentifier();
} else {
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
}