Bug 1356960 - Avoid to allocate WebRenderTextureHost for TextureHost of VideoBridgeParent and VRManagerParent r=jerry

This commit is contained in:
sotaro
2017-04-17 22:08:43 +09:00
parent a1df68e319
commit 40ad1d8199
3 changed files with 10 additions and 3 deletions

View File

@@ -90,12 +90,14 @@ public:
};
static bool
WrapWithWebRenderTextureHost(LayersBackend aBackend,
WrapWithWebRenderTextureHost(ISurfaceAllocator* aDeallocator,
LayersBackend aBackend,
TextureFlags aFlags)
{
if (!gfxVars::UseWebRender() ||
(aFlags & TextureFlags::SNAPSHOT) ||
(aBackend != LayersBackend::LAYERS_WR)) {
(aBackend != LayersBackend::LAYERS_WR) ||
(!aDeallocator->UsesImageBridge() && !aDeallocator->AsCompositorBridgeParentBase())) {
return false;
}
return true;
@@ -240,7 +242,7 @@ TextureHost::Create(const SurfaceDescriptor& aDesc,
MOZ_CRASH("GFX: Unsupported Surface type host");
}
if (WrapWithWebRenderTextureHost(aBackend, aFlags)) {
if (WrapWithWebRenderTextureHost(aDeallocator, aBackend, aFlags)) {
result = new WebRenderTextureHost(aDesc, aFlags, result);
}

View File

@@ -117,6 +117,8 @@ public:
virtual ShmemAllocator* AsShmemAllocator() override { return this; }
virtual CompositorBridgeParentBase* AsCompositorBridgeParentBase() override { return this; }
virtual mozilla::ipc::IPCResult RecvSyncWithCompositor() override { return IPC_OK(); }
virtual void ObserveLayerUpdate(uint64_t aLayersId, uint64_t aEpoch, bool aActive) = 0;

View File

@@ -29,6 +29,7 @@ class DataSourceSurface;
namespace layers {
class CompositableForwarder;
class CompositorBridgeParentBase;
class TextureForwarder;
class ShmemAllocator;
@@ -89,6 +90,8 @@ public:
virtual LegacySurfaceDescriptorAllocator*
AsLegacySurfaceDescriptorAllocator() { return nullptr; }
virtual CompositorBridgeParentBase* AsCompositorBridgeParentBase() { return nullptr; }
// ipc info
virtual bool IPCOpen() const { return true; }