Bug 1187345 - Fix HwcComposer2D::mCompositorParent handling r=mwu

This commit is contained in:
Sotaro Ikeda 2015-07-24 11:28:28 -07:00
parent 123ad2aeb6
commit f3eaf62de3
4 changed files with 13 additions and 2 deletions

View File

@ -111,7 +111,7 @@ private:
nsTArray<layers::LayerComposite*> mHwcLayerMap;
bool mPrepared;
bool mHasHWVsync;
nsRefPtr<layers::CompositorParent> mCompositorParent;
layers::CompositorParent* mCompositorParent;
Mutex mLock;
};

View File

@ -763,6 +763,16 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
void
nsWindow::DestroyCompositor()
{
if (mCompositorParent && mScreen->IsPrimaryScreen()) {
// Unset CompositorParent
mComposer2D->SetCompositorParent(nullptr);
}
nsBaseWidget::DestroyCompositor();
}
void
nsWindow::BringToTop()
{

View File

@ -113,6 +113,7 @@ public:
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr);
virtual void DestroyCompositor();
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
const InputContextAction& aAction);

View File

@ -484,7 +484,7 @@ protected:
* require the compositor to be destroyed before ~nsBaseWidget is
* reached (This is the case with gtk2 for instance).
*/
void DestroyCompositor();
virtual void DestroyCompositor();
void DestroyLayerManager();
void FreeShutdownObserver();