Bug 785597 - Don't create a LayerManager for a content window of an invisible top-level window. r=snorp

This commit is contained in:
Kartikaya Gupta 2012-12-21 11:33:28 -05:00
parent df745970bc
commit dc90835f04

View File

@ -229,6 +229,10 @@ nsWindow::Create(nsIWidget *aParent,
mParent = parent;
}
#ifdef DEBUG_ANDROID_WIDGET
DumpWindows();
#endif
return NS_OK;
}
@ -250,6 +254,10 @@ nsWindow::Destroy(void)
nsBaseWidget::OnDestroy();
#ifdef DEBUG_ANDROID_WIDGET
DumpWindows();
#endif
return NS_OK;
}
@ -677,12 +685,10 @@ nsWindow::GetLayerManager(PLayersChild*, LayersBackend, LayerManagerPersistence,
return mLayerManager;
}
nsWindow *topWindow = TopWindow();
if (!topWindow) {
printf_stderr(" -- no topwindow\n");
mLayerManager = CreateBasicLayerManager();
return mLayerManager;
nsWindow *topLevelWindow = FindTopLevel();
if (!topLevelWindow || topLevelWindow->mWindowType == eWindowType_invisible) {
// don't create a layer manager for an invisible top-level window
return nullptr;
}
mUseLayersAcceleration = ComputeShouldAccelerate(mUseLayersAcceleration);