Backed out changeset 339795d0a51e (bug 1574746) for causing browser_startup_syncIPC.js failures CLOSED TREE

This commit is contained in:
Ciure Andrei 2020-04-21 04:32:44 +03:00
Родитель 6907ca1144
Коммит 33a2dc2141
2 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -3963,8 +3963,10 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
// gfxVars, used below.
Unused << gfxPlatform::GetPlatform();
bool useWebRender =
gfx::gfxVars::UseWebRender() && AllowWebRenderForThisWindow();
mIsAccelerated = ComputeShouldAccelerate();
bool useWebRender = gfx::gfxVars::UseWebRender() && mIsAccelerated;
MOZ_ASSERT(mIsAccelerated | !useWebRender);
if (mWindowType == eWindowType_toplevel) {

Просмотреть файл

@ -823,6 +823,12 @@ bool nsBaseWidget::IsSmallPopup() const {
}
bool nsBaseWidget::ComputeShouldAccelerate() {
if (gfx::gfxVars::UseWebRender() && !AllowWebRenderForThisWindow()) {
// If WebRender is enabled, non-WebRender widgets use the basic compositor
// (at least for now), even though they would get an accelerated compositor
// if WebRender wasn't enabled.
return false;
}
return gfx::gfxConfig::IsEnabled(gfx::Feature::HW_COMPOSITING) &&
WidgetTypeSupportsAcceleration();
}
@ -835,6 +841,13 @@ bool nsBaseWidget::UseAPZ() {
StaticPrefs::apz_popups_enabled())));
}
bool nsBaseWidget::AllowWebRenderForThisWindow() {
return WindowType() == eWindowType_toplevel ||
WindowType() == eWindowType_child ||
WindowType() == eWindowType_dialog ||
(WindowType() == eWindowType_popup && HasRemoteContent());
}
void nsBaseWidget::CreateCompositor() {
LayoutDeviceIntRect rect = GetBounds();
CreateCompositor(rect.Width(), rect.Height());
@ -1199,8 +1212,9 @@ already_AddRefed<LayerManager> nsBaseWidget::CreateCompositorSession(
// If widget type does not supports acceleration, we use ClientLayerManager
// even when gfxVars::UseWebRender() is true. WebRender could coexist only
// with BasicCompositor.
bool enableWR =
gfx::gfxVars::UseWebRender() && WidgetTypeSupportsAcceleration();
bool enableWR = gfx::gfxVars::UseWebRender() &&
WidgetTypeSupportsAcceleration() &&
AllowWebRenderForThisWindow();
bool enableAPZ = UseAPZ();
CompositorOptions options(enableAPZ, enableWR);