Don't require a Compositor for texture backend checks. (bug 1365879 part 12, r=mattwoodrow)

This commit is contained in:
David Anderson 2017-06-20 01:17:19 -07:00
Родитель 392b83f1c4
Коммит 3a500a9070
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -98,10 +98,6 @@ public:
MOZ_CRASH("GFX: Call on compositor, not LayerManagerComposite");
}
virtual LayersBackend GetBackendType() override
{
MOZ_CRASH("GFX: Shouldn't be called for composited layer manager");
}
virtual void GetBackendName(nsAString& name) override
{
MOZ_CRASH("GFX: Shouldn't be called for composited layer manager");
@ -403,10 +399,12 @@ public:
bool AsyncPanZoomEnabled() const override;
public:
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override
{
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override {
return mCompositor->GetTextureFactoryIdentifier();
}
virtual LayersBackend GetBackendType() override {
return mCompositor ? mCompositor->GetBackendType() : LayersBackend::LAYERS_NONE;
}
void ForcePresent() override { mCompositor->ForcePresent(); }

Просмотреть файл

@ -506,6 +506,11 @@ CrossProcessCompositorBridgeParent::AllocPTextureParent(const SurfaceDescriptor&
TextureFlags flags = aFlags;
LayersBackend actualBackend = LayersBackend::LAYERS_NONE;
if (state && state->mLayerManager) {
actualBackend = state->mLayerManager->GetBackendType();
}
if (!state) {
// The compositor was recreated, and we're receiving layers updates for a
// a layer manager that will soon be discarded or invalidated. We can't
@ -513,8 +518,7 @@ CrossProcessCompositorBridgeParent::AllocPTextureParent(const SurfaceDescriptor&
// kill the content process. Instead, we signal that the underlying
// TextureHost should not attempt to access the compositor.
flags |= TextureFlags::INVALID_COMPOSITOR;
} else if (state->mLayerManager && state->mLayerManager->GetCompositor() &&
aLayersBackend != state->mLayerManager->GetCompositor()->GetBackendType()) {
} else if (actualBackend != LayersBackend::LAYERS_NONE && aLayersBackend != actualBackend) {
gfxDevCrash(gfx::LogReason::PAllocTextureBackendMismatch) << "Texture backend is wrong";
}