diff --git a/gfx/layers/Compositor.cpp b/gfx/layers/Compositor.cpp index 5d2fef3f58e6..2ddf4f05c9ec 100644 --- a/gfx/layers/Compositor.cpp +++ b/gfx/layers/Compositor.cpp @@ -18,31 +18,6 @@ class Matrix4x4; namespace layers { -/* static */ LayersBackend Compositor::sBackend = LayersBackend::LAYERS_NONE; -/* static */ LayersBackend -Compositor::GetBackend() -{ - if (sBackend != LayersBackend::LAYERS_NONE) { - AssertOnCompositorThread(); - } - return sBackend; -} - -/* static */ void -Compositor::SetBackend(LayersBackend backend) -{ - if (!gIsGtest && sBackend != backend && - sBackend != LayersBackend::LAYERS_NONE && - backend != LayersBackend::LAYERS_NONE) { - // Assert this once we figure out bug 972891. -#ifdef XP_MACOSX - gfxWarning() << "Changing compositor from " << unsigned(sBackend) << " to " << unsigned(backend); -#endif - } - - sBackend = backend; -} - /* static */ void Compositor::AssertOnCompositorThread() { diff --git a/gfx/layers/Compositor.h b/gfx/layers/Compositor.h index 89c2b360fc90..13648a9289e5 100644 --- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -463,16 +463,6 @@ public: */ static void AssertOnCompositorThread(); - /** - * We enforce that there can only be one Compositor backend type off the main - * thread at the same time. The backend type in use can be checked with this - * static method. We need this for creating texture clients/hosts etc. when we - * don't have a reference to a Compositor. - * - * This can only be used from the compositor thread! - */ - static LayersBackend GetBackend(); - size_t GetFillRatio() { float fillRatio = 0; if (mPixelsFilled > 0 && mPixelsPerFrame > 0) { @@ -521,11 +511,6 @@ protected: bool ShouldDrawDiagnostics(DiagnosticFlags); - /** - * Set the global Compositor backend, checking that one isn't already set. - */ - static void SetBackend(LayersBackend backend); - /** * Render time for the current composition. */ diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index c1997f2b6aaf..6328cef755d8 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -71,7 +71,6 @@ BasicCompositor::BasicCompositor(nsIWidget *aWidget) : mWidget(aWidget) { MOZ_COUNT_CTOR(BasicCompositor); - SetBackend(LayersBackend::LAYERS_BASIC); mMaxTextureSize = Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackendFor(LayersBackend::LAYERS_BASIC)); diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index c7fd08112215..327bbe56a8bc 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -285,7 +285,7 @@ TextureClient::InitIPDLActor(CompositableForwarder* aForwarder) return false; } - mActor = static_cast(aForwarder->CreateTexture(desc, GetFlags())); + mActor = static_cast(aForwarder->CreateTexture(desc, aForwarder->GetCompositorBackendType(), GetFlags())); MOZ_ASSERT(mActor); mActor->mForwarder = aForwarder; mActor->mTextureClient = this; diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index c8fc7e05bf33..1e50b17d3ab3 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -161,7 +161,7 @@ LayerManagerComposite::UpdateRenderBounds(const IntRect& aRect) bool LayerManagerComposite::AreComponentAlphaLayersEnabled() { - return Compositor::GetBackend() != LayersBackend::LAYERS_BASIC && + return mCompositor->GetBackendType() != LayersBackend::LAYERS_BASIC && LayerManager::AreComponentAlphaLayersEnabled(); } diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index 9f2458c8e14f..c2a1ee90888e 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -69,6 +69,7 @@ public: ~TextureParent(); bool Init(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags); void CompositorRecycle(); @@ -93,11 +94,10 @@ public: }; //////////////////////////////////////////////////////////////////////////////// - -// static PTextureParent* TextureHost::CreateIPDLActor(CompositableParentManager* aManager, const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags) { if (aSharedData.type() == SurfaceDescriptor::TSurfaceDescriptorMemory && @@ -107,7 +107,7 @@ TextureHost::CreateIPDLActor(CompositableParentManager* aManager, return nullptr; } TextureParent* actor = new TextureParent(aManager); - if (!actor->Init(aSharedData, aFlags)) { + if (!actor->Init(aSharedData, aLayersBackend, aFlags)) { delete actor; return nullptr; } @@ -200,10 +200,10 @@ already_AddRefed CreateTextureHostD3D9(const SurfaceDescriptor& aDe ISurfaceAllocator* aDeallocator, TextureFlags aFlags); -// static already_AddRefed TextureHost::Create(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, + LayersBackend aBackend, TextureFlags aFlags) { switch (aDesc.type()) { @@ -219,7 +219,7 @@ TextureHost::Create(const SurfaceDescriptor& aDesc, return CreateTextureHostOGL(aDesc, aDeallocator, aFlags); case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface: - if (Compositor::GetBackend() == LayersBackend::LAYERS_OPENGL) { + if (aBackend == LayersBackend::LAYERS_OPENGL) { return CreateTextureHostOGL(aDesc, aDeallocator, aFlags); } else { return CreateTextureHostBasic(aDesc, aDeallocator, aFlags); @@ -238,7 +238,7 @@ TextureHost::Create(const SurfaceDescriptor& aDesc, case SurfaceDescriptor::TSurfaceDescriptorD3D10: case SurfaceDescriptor::TSurfaceDescriptorDXGIYCbCr: - if (Compositor::GetBackend() == LayersBackend::LAYERS_D3D9) { + if (aBackend == LayersBackend::LAYERS_D3D9) { return CreateTextureHostD3D9(aDesc, aDeallocator, aFlags); } else { return CreateTextureHostD3D11(aDesc, aDeallocator, aFlags); @@ -798,10 +798,12 @@ TextureParent::RecvClientRecycle() bool TextureParent::Init(const SurfaceDescriptor& aSharedData, + const LayersBackend& aBackend, const TextureFlags& aFlags) { mTextureHost = TextureHost::Create(aSharedData, mCompositableManager, + aBackend, aFlags); if (mTextureHost) { mTextureHost->mActor = this; diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index 66a0fee8dc51..22c9685ece21 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -325,9 +325,11 @@ public: /** * Factory method. */ - static already_AddRefed Create(const SurfaceDescriptor& aDesc, - ISurfaceAllocator* aDeallocator, - TextureFlags aFlags); + static already_AddRefed Create( + const SurfaceDescriptor& aDesc, + ISurfaceAllocator* aDeallocator, + LayersBackend aBackend, + TextureFlags aFlags); /** * Tell to TextureChild that TextureHost is recycled. @@ -450,6 +452,7 @@ public: */ static PTextureParent* CreateIPDLActor(CompositableParentManager* aManager, const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags); static bool DestroyIPDLActor(PTextureParent* actor); diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index b15be851bd1e..7ede70fb16f1 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -154,7 +154,6 @@ CompositorD3D11::CompositorD3D11(nsIWidget* aWidget) , mHwnd(nullptr) , mDisableSequenceForNextFrame(false) { - SetBackend(LayersBackend::LAYERS_D3D11); } CompositorD3D11::~CompositorD3D11() diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index 3cd28b55ff1a..ab703aa288e1 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -29,7 +29,6 @@ CompositorD3D9::CompositorD3D9(PCompositorParent* aParent, nsIWidget *aWidget) , mDeviceResetCount(0) , mFailedResetAttempts(0) { - Compositor::SetBackend(LayersBackend::LAYERS_D3D9); } CompositorD3D9::~CompositorD3D9() diff --git a/gfx/layers/ipc/CompositableForwarder.h b/gfx/layers/ipc/CompositableForwarder.h index 11755b7000b6..e3e37a86c427 100644 --- a/gfx/layers/ipc/CompositableForwarder.h +++ b/gfx/layers/ipc/CompositableForwarder.h @@ -64,7 +64,10 @@ public: /** * Create a TextureChild/Parent pair as as well as the TextureHost on the parent side. */ - virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData, TextureFlags aFlags) = 0; + virtual PTextureChild* CreateTexture( + const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, + TextureFlags aFlags) = 0; /** * Communicate to the compositor that aRegion in the texture identified by @@ -166,7 +169,7 @@ public: * We only don't allow changing the backend type at runtime so this value can * be queried once and will not change until Gecko is restarted. */ - virtual LayersBackend GetCompositorBackendType() const override + LayersBackend GetCompositorBackendType() const override { return mTextureFactoryIdentifier.mParentBackend; } diff --git a/gfx/layers/ipc/ISurfaceAllocator.h b/gfx/layers/ipc/ISurfaceAllocator.h index c65860e8da34..298162329959 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.h +++ b/gfx/layers/ipc/ISurfaceAllocator.h @@ -84,12 +84,8 @@ public: void Finalize(); /** - * Returns the type of backend that is used off the main thread. - * We only don't allow changing the backend type at runtime so this value can - * be queried once and will not change until Gecko is restarted. - * - * XXX - With e10s this may not be true anymore. we can have accelerated widgets - * and non-accelerated widgets (small popups, etc.) + * Returns the preferred compositor backend type for drawing. If not known + * or not supported, LAYERS_NONE is returned. */ virtual LayersBackend GetCompositorBackendType() const = 0; diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index a47bcb604584..ba9e2e1c0ac5 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -856,6 +856,7 @@ ImageBridgeChild::DeallocShmem(ipc::Shmem& aShmem) PTextureChild* ImageBridgeChild::AllocPTextureChild(const SurfaceDescriptor&, + const LayersBackend&, const TextureFlags&) { MOZ_ASSERT(!mShuttingDown); @@ -951,10 +952,11 @@ ImageBridgeChild::RecvDidComposite(InfallibleTArray& PTextureChild* ImageBridgeChild::CreateTexture(const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags) { MOZ_ASSERT(!mShuttingDown); - return SendPTextureConstructor(aSharedData, aFlags); + return SendPTextureConstructor(aSharedData, aLayersBackend, aFlags); } void diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h index 8d4f6c087b01..c57c40a9a53f 100644 --- a/gfx/layers/ipc/ImageBridgeChild.h +++ b/gfx/layers/ipc/ImageBridgeChild.h @@ -185,7 +185,7 @@ public: ~ImageBridgeChild(); virtual PTextureChild* - AllocPTextureChild(const SurfaceDescriptor& aSharedData, const TextureFlags& aFlags) override; + AllocPTextureChild(const SurfaceDescriptor& aSharedData, const LayersBackend& aLayersBackend, const TextureFlags& aFlags) override; virtual bool DeallocPTextureChild(PTextureChild* actor) override; @@ -292,6 +292,7 @@ public: virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem) override; virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags) override; virtual bool IsSameProcess() const override; diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index f810a73d8be2..6850a5cacec3 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -91,12 +91,6 @@ ImageBridgeParent::~ImageBridgeParent() sImageBridges.erase(OtherPid()); } -LayersBackend -ImageBridgeParent::GetCompositorBackendType() const -{ - return Compositor::GetBackend(); -} - void ImageBridgeParent::ActorDestroy(ActorDestroyReason aWhy) { @@ -138,12 +132,6 @@ ImageBridgeParent::RecvUpdate(EditArray&& aEdits, EditReplyArray* aReply) { AutoImageBridgeParentAsyncMessageSender autoAsyncMessageSender(this); - // If we don't actually have a compositor, then don't bother - // creating any textures. - if (Compositor::GetBackend() == LayersBackend::LAYERS_NONE) { - return true; - } - EditReplyVector replyv; for (EditArray::index_type i = 0; i < aEdits.Length(); ++i) { if (!ReceiveCompositableUpdate(aEdits[i], replyv)) { @@ -256,9 +244,10 @@ bool ImageBridgeParent::DeallocPCompositableParent(PCompositableParent* aActor) PTextureParent* ImageBridgeParent::AllocPTextureParent(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags) { - return TextureHost::CreateIPDLActor(this, aSharedData, aFlags); + return TextureHost::CreateIPDLActor(this, aSharedData, aLayersBackend, aFlags); } bool diff --git a/gfx/layers/ipc/ImageBridgeParent.h b/gfx/layers/ipc/ImageBridgeParent.h index 9cfba1a20bae..d509c970fade 100644 --- a/gfx/layers/ipc/ImageBridgeParent.h +++ b/gfx/layers/ipc/ImageBridgeParent.h @@ -49,7 +49,10 @@ public: ImageBridgeParent(MessageLoop* aLoop, Transport* aTransport, ProcessId aChildProcessId); ~ImageBridgeParent(); - virtual LayersBackend GetCompositorBackendType() const override; + LayersBackend GetCompositorBackendType() const override { + MOZ_CRASH("ImageBridgeParent does not support GetCompositorBackendType"); + return LayersBackend::LAYERS_NONE; + } virtual void ActorDestroy(ActorDestroyReason aWhy) override; @@ -80,6 +83,7 @@ public: bool DeallocPCompositableParent(PCompositableParent* aActor) override; virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags) override; virtual bool DeallocPTextureParent(PTextureParent* actor) override; diff --git a/gfx/layers/ipc/LayerTransactionChild.cpp b/gfx/layers/ipc/LayerTransactionChild.cpp index 50ff57a187c3..c61c9c94e601 100644 --- a/gfx/layers/ipc/LayerTransactionChild.cpp +++ b/gfx/layers/ipc/LayerTransactionChild.cpp @@ -126,6 +126,7 @@ LayerTransactionChild::ActorDestroy(ActorDestroyReason why) PTextureChild* LayerTransactionChild::AllocPTextureChild(const SurfaceDescriptor&, + const LayersBackend&, const TextureFlags&) { MOZ_ASSERT(!mDestroyed); diff --git a/gfx/layers/ipc/LayerTransactionChild.h b/gfx/layers/ipc/LayerTransactionChild.h index fc8e64740286..765f9d73a87a 100644 --- a/gfx/layers/ipc/LayerTransactionChild.h +++ b/gfx/layers/ipc/LayerTransactionChild.h @@ -65,6 +65,7 @@ protected: virtual bool DeallocPCompositableChild(PCompositableChild* actor) override; virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags) override; virtual bool DeallocPTextureChild(PTextureChild* actor) override; diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index c474152d0f60..7e04c167b567 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -924,9 +924,11 @@ LayerTransactionParent::DeallocPCompositableParent(PCompositableParent* aActor) PTextureParent* LayerTransactionParent::AllocPTextureParent(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags) { - return TextureHost::CreateIPDLActor(this, aSharedData, aFlags); + MOZ_ASSERT(aLayersBackend == mLayerManager->GetCompositor()->GetBackendType()); + return TextureHost::CreateIPDLActor(this, aSharedData, aLayersBackend, aFlags); } bool diff --git a/gfx/layers/ipc/LayerTransactionParent.h b/gfx/layers/ipc/LayerTransactionParent.h index 19464f029272..7d5d8aee7553 100644 --- a/gfx/layers/ipc/LayerTransactionParent.h +++ b/gfx/layers/ipc/LayerTransactionParent.h @@ -150,6 +150,7 @@ protected: virtual bool DeallocPCompositableParent(PCompositableParent* actor) override; virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData, + const LayersBackend& aLayersBackend, const TextureFlags& aFlags) override; virtual bool DeallocPTextureParent(PTextureParent* actor) override; diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index d6ef82b45e40..6bc6c5784728 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -42,6 +42,7 @@ using mozilla::layers::DiagnosticTypes from "mozilla/layers/CompositorTypes.h"; using struct mozilla::layers::FrameMetrics from "FrameMetrics.h"; using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h"; using struct mozilla::layers::FenceHandle from "mozilla/layers/FenceUtils.h"; +using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; namespace mozilla { namespace layers { diff --git a/gfx/layers/ipc/PImageBridge.ipdl b/gfx/layers/ipc/PImageBridge.ipdl index 99a4a704407f..c23350f0221d 100644 --- a/gfx/layers/ipc/PImageBridge.ipdl +++ b/gfx/layers/ipc/PImageBridge.ipdl @@ -59,7 +59,7 @@ parent: sync PCompositable(TextureInfo aInfo, PImageContainer aImageContainer) returns (uint64_t id); - async PTexture(SurfaceDescriptor aSharedData, TextureFlags aTextureFlags); + async PTexture(SurfaceDescriptor aSharedData, LayersBackend aBackend, TextureFlags aTextureFlags); async PMediaSystemResourceManager(); async PImageContainer(); diff --git a/gfx/layers/ipc/PLayerTransaction.ipdl b/gfx/layers/ipc/PLayerTransaction.ipdl index 6f36c9371592..50ab06fa43a7 100644 --- a/gfx/layers/ipc/PLayerTransaction.ipdl +++ b/gfx/layers/ipc/PLayerTransaction.ipdl @@ -21,6 +21,7 @@ using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h"; using class mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h"; using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h"; using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h"; +using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; /** * The layers protocol is spoken between thread contexts that manage @@ -50,7 +51,7 @@ child: parent: async PLayer(); async PCompositable(TextureInfo aTextureInfo); - async PTexture(SurfaceDescriptor aSharedData, TextureFlags aTextureFlags); + async PTexture(SurfaceDescriptor aSharedData, LayersBackend aBackend, TextureFlags aTextureFlags); // The isFirstPaint flag can be used to indicate that this is the first update // for a particular document. diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index bb8a2c4fe682..b78595e1d796 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -816,13 +816,14 @@ void ShadowLayerForwarder::AttachAsyncCompositable(uint64_t aCompositableID, PTextureChild* ShadowLayerForwarder::CreateTexture(const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags) { if (!HasShadowManager() || !mShadowManager->IPCOpen()) { return nullptr; } - return mShadowManager->SendPTextureConstructor(aSharedData, aFlags); + return mShadowManager->SendPTextureConstructor(aSharedData, aLayersBackend, aFlags); } diff --git a/gfx/layers/ipc/ShadowLayers.h b/gfx/layers/ipc/ShadowLayers.h index cd38e0cd5048..f8956905fd58 100644 --- a/gfx/layers/ipc/ShadowLayers.h +++ b/gfx/layers/ipc/ShadowLayers.h @@ -128,6 +128,7 @@ public: ImageContainer* aImageContainer) override; virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData, + LayersBackend aLayersBackend, TextureFlags aFlags) override; /** diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index e5865d096d4d..6a39e49db5b7 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -92,7 +92,6 @@ CompositorOGL::CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth, , mCurrentProgram(nullptr) { MOZ_COUNT_CTOR(CompositorOGL); - SetBackend(LayersBackend::LAYERS_OPENGL); } CompositorOGL::~CompositorOGL() diff --git a/gfx/layers/opengl/GLManager.cpp b/gfx/layers/opengl/GLManager.cpp index e748cfc8efb3..233128ef0b93 100644 --- a/gfx/layers/opengl/GLManager.cpp +++ b/gfx/layers/opengl/GLManager.cpp @@ -62,8 +62,7 @@ private: /* static */ GLManager* GLManager::CreateGLManager(LayerManagerComposite* aManager) { - if (aManager && - Compositor::GetBackend() == LayersBackend::LAYERS_OPENGL) { + if (aManager && aManager->GetCompositor()->GetBackendType() == LayersBackend::LAYERS_OPENGL) { return new GLManagerCompositor(static_cast( aManager->GetCompositor())); }