diff --git a/gfx/ipc/CompositorOptions.h b/gfx/ipc/CompositorOptions.h index f2d498839e5e..31f2878ebdf3 100644 --- a/gfx/ipc/CompositorOptions.h +++ b/gfx/ipc/CompositorOptions.h @@ -33,6 +33,7 @@ public: : mUseAPZ(false) , mUseWebRender(false) , mUseAdvancedLayers(false) + , mInitiallyPaused(false) { } @@ -41,17 +42,23 @@ public: : mUseAPZ(aUseAPZ) , mUseWebRender(aUseWebRender) , mUseAdvancedLayers(false) + , mInitiallyPaused(false) { } bool UseAPZ() const { return mUseAPZ; } bool UseWebRender() const { return mUseWebRender; } bool UseAdvancedLayers() const { return mUseAdvancedLayers; } + bool InitiallyPaused() const { return mInitiallyPaused; } void SetUseAdvancedLayers(bool aUseAdvancedLayers) { mUseAdvancedLayers = aUseAdvancedLayers; } + void SetInitiallyPaused(bool aPauseAtStartup) { + mInitiallyPaused = aPauseAtStartup; + } + bool operator==(const CompositorOptions& aOther) const { return mUseAPZ == aOther.mUseAPZ && mUseWebRender == aOther.mUseWebRender && @@ -64,8 +71,10 @@ private: bool mUseAPZ; bool mUseWebRender; bool mUseAdvancedLayers; + bool mInitiallyPaused; // Make sure to add new fields to the ParamTraits implementation + // in LayersMessageUtils.h }; } // namespace layers diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 96f02bf323fb..40eb1aa5ae07 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -411,6 +411,8 @@ CompositorBridgeParent::Initialize() mApzUpdater = new APZUpdater(mApzcTreeManager, mOptions.UseWebRender()); } + mPaused = mOptions.InitiallyPaused(); + mCompositorBridgeID = 0; // FIXME: This holds on the the fact that right now the only thing that // can destroy this instance is initialized on the compositor thread after diff --git a/gfx/layers/ipc/LayersMessageUtils.h b/gfx/layers/ipc/LayersMessageUtils.h index 27fa7a3ca2ca..6d008d018cf1 100644 --- a/gfx/layers/ipc/LayersMessageUtils.h +++ b/gfx/layers/ipc/LayersMessageUtils.h @@ -635,12 +635,14 @@ struct ParamTraits WriteParam(aMsg, aParam.mUseAPZ); WriteParam(aMsg, aParam.mUseWebRender); WriteParam(aMsg, aParam.mUseAdvancedLayers); + WriteParam(aMsg, aParam.mInitiallyPaused); } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) { return ReadParam(aMsg, aIter, &aResult->mUseAPZ) && ReadParam(aMsg, aIter, &aResult->mUseWebRender) - && ReadParam(aMsg, aIter, &aResult->mUseAdvancedLayers); + && ReadParam(aMsg, aIter, &aResult->mUseAdvancedLayers) + && ReadParam(aMsg, aIter, &aResult->mInitiallyPaused); } }; diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 87aee3c4e137..f9bdcd4b647b 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -1323,6 +1323,12 @@ nsBaseWidget::CreateCompositorSession(int aWidth, bool enableAL = gfx::gfxConfig::IsEnabled(gfx::Feature::ADVANCED_LAYERS); options.SetUseAdvancedLayers(enableAL); +#ifdef MOZ_WIDGET_ANDROID + if (!GetNativeData(NS_JAVA_SURFACE)) { + options.SetInitiallyPaused(true); + } +#endif + RefPtr lm; if (options.UseWebRender()) { lm = new WebRenderLayerManager(this);