--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1279,17 +1279,17 @@ already_AddRefed<CompositorVsyncDispatch
nsBaseWidget::GetCompositorVsyncDispatcher() {
MOZ_ASSERT(mCompositorVsyncDispatcherLock.get());
MutexAutoLock lock(*mCompositorVsyncDispatcherLock.get());
RefPtr<CompositorVsyncDispatcher> dispatcher = mCompositorVsyncDispatcher;
return dispatcher.forget();
}
-already_AddRefed<LayerManager> nsBaseWidget::CreateCompositorSession(
+already_AddRefed<WebRenderLayerManager> nsBaseWidget::CreateCompositorSession(
int aWidth, int aHeight, CompositorOptions* aOptionsOut) {
MOZ_ASSERT(aOptionsOut);
do {
CreateCompositorVsyncDispatcher();
gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
// Make sure GPU process is ready for use.
@@ -1334,30 +1334,29 @@ already_AddRefed<LayerManager> nsBaseWid
#ifdef MOZ_WIDGET_ANDROID
if (!GetNativeData(NS_JAVA_SURFACE)) {
options.SetInitiallyPaused(true);
}
#else
options.SetInitiallyPaused(CompositorInitiallyPaused());
#endif
- RefPtr<LayerManager> lm = new WebRenderLayerManager(this);
+ RefPtr<WebRenderLayerManager> lm = new WebRenderLayerManager(this);
bool retry = false;
mCompositorSession = gpu->CreateTopLevelCompositor(
this, lm, GetDefaultScale(), options, UseExternalCompositingSurface(),
gfx::IntSize(aWidth, aHeight), &retry);
if (mCompositorSession) {
TextureFactoryIdentifier textureFactoryIdentifier;
nsCString error;
- lm->AsWebRenderLayerManager()->Initialize(
- mCompositorSession->GetCompositorBridgeChild(),
- wr::AsPipelineId(mCompositorSession->RootLayerTreeId()),
- &textureFactoryIdentifier, error);
+ lm->Initialize(mCompositorSession->GetCompositorBridgeChild(),
+ wr::AsPipelineId(mCompositorSession->RootLayerTreeId()),
+ &textureFactoryIdentifier, error);
if (textureFactoryIdentifier.mParentBackend != LayersBackend::LAYERS_WR) {
retry = true;
DestroyCompositor();
// gfxVars::UseDoubleBufferingWithCompositor() is also disabled.
gfx::GPUProcessManager::Get()->DisableWebRender(
wr::WebRenderError::INITIALIZE, error);
}
}
@@ -1391,17 +1390,18 @@ void nsBaseWidget::CreateCompositor(int
// If we've already received a shutdown notification, don't try
// create a new compositor.
if (!mShutdownObserver) {
return;
}
CompositorOptions options;
- RefPtr<LayerManager> lm = CreateCompositorSession(aWidth, aHeight, &options);
+ RefPtr<WebRenderLayerManager> lm =
+ CreateCompositorSession(aWidth, aHeight, &options);
if (!lm) {
return;
}
MOZ_ASSERT(mCompositorSession);
mCompositorBridgeChild = mCompositorSession->GetCompositorBridgeChild();
SetCompositorWidgetDelegate(
mCompositorSession->GetCompositorWidgetDelegate());
@@ -1415,24 +1415,22 @@ void nsBaseWidget::CreateCompositor(int
if (mInitialZoomConstraints) {
UpdateZoomConstraints(mInitialZoomConstraints->mPresShellID,
mInitialZoomConstraints->mViewID,
Some(mInitialZoomConstraints->mConstraints));
mInitialZoomConstraints.reset();
}
- if (lm->AsWebRenderLayerManager()) {
- TextureFactoryIdentifier textureFactoryIdentifier =
- lm->GetTextureFactoryIdentifier();
- MOZ_ASSERT(textureFactoryIdentifier.mParentBackend ==
- LayersBackend::LAYERS_WR);
- ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
- gfx::VRManagerChild::IdentifyTextureHost(textureFactoryIdentifier);
- }
+ TextureFactoryIdentifier textureFactoryIdentifier =
+ lm->GetTextureFactoryIdentifier();
+ MOZ_ASSERT(textureFactoryIdentifier.mParentBackend ==
+ LayersBackend::LAYERS_WR);
+ ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
+ gfx::VRManagerChild::IdentifyTextureHost(textureFactoryIdentifier);
WindowUsesOMTC();
mWindowRenderer = std::move(lm);
// Only track compositors for top-level windows, since other window types
// may use the basic compositor. Except on the OS X - see bug 1306383
#if defined(XP_MACOSX)