mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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
3728dd7ebc
commit
3930f84ffc
@ -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