mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 824868. Make AutoLayerManagerSetup save the layer manager it is using so we are sure to use the right oen when it goes out of scope to clean up. r=roc
This commit is contained in:
parent
75183b51dd
commit
e3d67a383a
@ -736,25 +736,22 @@ nsBaseWidget::AutoLayerManagerSetup::AutoLayerManagerSetup(
|
||||
BufferMode aDoubleBuffering, ScreenRotation aRotation)
|
||||
: mWidget(aWidget)
|
||||
{
|
||||
BasicLayerManager* manager =
|
||||
static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
|
||||
if (manager) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
mLayerManager = static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
|
||||
if (mLayerManager) {
|
||||
NS_ASSERTION(mLayerManager->GetBackendType() == LAYERS_BASIC,
|
||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||
manager->SetDefaultTarget(aTarget);
|
||||
manager->SetDefaultTargetConfiguration(aDoubleBuffering, aRotation);
|
||||
mLayerManager->SetDefaultTarget(aTarget);
|
||||
mLayerManager->SetDefaultTargetConfiguration(aDoubleBuffering, aRotation);
|
||||
}
|
||||
}
|
||||
|
||||
nsBaseWidget::AutoLayerManagerSetup::~AutoLayerManagerSetup()
|
||||
{
|
||||
BasicLayerManager* manager =
|
||||
static_cast<BasicLayerManager*>(mWidget->GetLayerManager());
|
||||
if (manager) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
if (mLayerManager) {
|
||||
NS_ASSERTION(mLayerManager->GetBackendType() == LAYERS_BASIC,
|
||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||
manager->SetDefaultTarget(nullptr);
|
||||
manager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE, ROTATION_0);
|
||||
mLayerManager->SetDefaultTarget(nullptr);
|
||||
mLayerManager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE, ROTATION_0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,7 @@ public:
|
||||
~AutoLayerManagerSetup();
|
||||
private:
|
||||
nsBaseWidget* mWidget;
|
||||
nsRefPtr<BasicLayerManager> mLayerManager;
|
||||
};
|
||||
friend class AutoLayerManagerSetup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user