Allow top-level window changes to the remembered compositor type. (bug 1211109 part 3, r=mattwoodrow)

This commit is contained in:
David Anderson 2015-10-05 23:39:28 -07:00
parent 07ff755338
commit e1d5f8bc99
2 changed files with 9 additions and 2 deletions

View File

@ -2208,7 +2208,10 @@ gfxPlatform::NotifyCompositorCreated(LayersBackend aBackend)
return;
}
NS_ASSERTION(mCompositorBackend == LayersBackend::LAYERS_NONE, "Compositor backend changed.");
if (mCompositorBackend != LayersBackend::LAYERS_NONE) {
gfxCriticalNote << "Compositors might be mixed ("
<< int(mCompositorBackend) << "," << int(aBackend) << ")";
}
// Set the backend before we notify so it's available immediately.
mCompositorBackend = aBackend;

View File

@ -1132,7 +1132,11 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
mLayerManager = lm.forget();
gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType());
if (mWindowType == eWindowType_toplevel) {
// Only track compositors for top-level windows, since other window types
// may use the basic compositor.
gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType());
}
}
bool nsBaseWidget::ShouldUseOffMainThreadCompositing()