Bug 1356960 - Avoid to allocate WebRenderTextureHost for TextureHost of VideoBridgeParent and VRManagerParent r=jerry
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user