Bug 1154739 - On desktop platforms, only enable APZ in e10s windows. r=dvander,mstange

This commit is contained in:
Kartikaya Gupta 2015-04-27 16:13:29 -04:00
parent 57b4bbe2ca
commit f300e99712
4 changed files with 22 additions and 0 deletions

View File

@ -479,6 +479,7 @@ public:
#endif
virtual void CreateCompositor() override;
virtual bool IsMultiProcessWindow() override;
virtual void PrepareWindowEffects() override;
virtual void CleanupWindowEffects() override;
virtual bool PreRender(LayerManagerComposite* aManager) override;

View File

@ -1885,6 +1885,16 @@ nsChildView::CreateCompositor()
}
}
bool
nsChildView::IsMultiProcessWindow()
{
// On OS X the XULWindowWidget object gets the widget's init-data, which
// is what has the electrolysis window flag. So here in the child view
// we need to get the flag from that window instead.
nsCocoaWindow* parent = GetXULWindowWidget();
return parent ? parent->IsMultiProcessWindow() : false;
}
void
nsChildView::ConfigureAPZCTreeManager()
{

View File

@ -953,6 +953,10 @@ private:
nsRefPtr<APZCTreeManager> mTreeManager;
};
bool nsBaseWidget::IsMultiProcessWindow()
{
return mMultiProcessWindow;
}
void nsBaseWidget::ConfigureAPZCTreeManager()
{
@ -1145,6 +1149,12 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
mCompositorParent->SetOtherProcessId(base::GetCurrentProcId());
if (gfxPrefs::AsyncPanZoomEnabled() &&
#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_GTK)
// For desktop platforms we only want to use APZ in e10s-enabled windows.
// If we ever get input events off the main thread we can consider
// relaxing this requirement.
IsMultiProcessWindow() &&
#endif
(WindowType() == eWindowType_toplevel || WindowType() == eWindowType_child)) {
ConfigureAPZCTreeManager();
}

View File

@ -154,6 +154,7 @@ public:
virtual CompositorParent* NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight);
virtual void CreateCompositor();
virtual void CreateCompositor(int aWidth, int aHeight);
virtual bool IsMultiProcessWindow();
virtual void PrepareWindowEffects() override {}
virtual void CleanupWindowEffects() override {}
virtual bool PreRender(LayerManagerComposite* aManager) override { return true; }