Loading dom/ipc/TabChild.cpp +21 −10 Original line number Diff line number Diff line Loading @@ -388,13 +388,6 @@ TabChild::TabChild(nsIContentChild* aManager, , mNativeWindowHandle(0) #endif { // In the general case having the TabParent tell us if APZ is enabled or not // doesn't really work because the TabParent itself may not have a reference // to the owning widget during initialization. Instead we assume that this // TabChild corresponds to a widget type that would have APZ enabled, and just // check the other conditions necessary for enabling APZ. mAsyncPanZoomEnabled = gfxPlatform::AsyncPanZoomEnabled(); nsWeakPtr weakPtrThis(do_GetWeakReference(static_cast<nsITabChild*>(this))); // for capture by the lambda mSetAllowedTouchBehaviorCallback = [weakPtrThis](uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aFlags) Loading Loading @@ -431,6 +424,15 @@ TabChild::TabChild(nsIContentChild* aManager, } } bool TabChild::AsyncPanZoomEnabled() const { // If we have received the CompositorOptions we can answer definitively. If // not, return a best guess based on gfxPlaform values. return mCompositorOptions ? mCompositorOptions->UseAPZ() : gfxPlatform::AsyncPanZoomEnabled(); } NS_IMETHODIMP TabChild::Observe(nsISupports *aSubject, const char *aTopic, Loading Loading @@ -2502,6 +2504,10 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden return; } CompositorOptions options; Unused << compositorChild->SendGetCompositorOptions(aLayersId, &options); mCompositorOptions = Some(options); ShadowLayerForwarder* lf = mPuppetWidget->GetLayerManager( nullptr, mTextureFactoryIdentifier.mParentBackend) Loading Loading @@ -2550,11 +2556,10 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden void TabChild::InitAPZState() { auto cbc = CompositorBridgeChild::Get(); if (!cbc->GetAPZEnabled(mLayersId)) { if (!mCompositorOptions->UseAPZ()) { return; } auto cbc = CompositorBridgeChild::Get(); // Initialize the ApzcTreeManager. This takes multiple casts because of ugly multiple inheritance. PAPZCTreeManagerChild* baseProtocol = cbc->SendPAPZCTreeManagerConstructor(mLayersId); Loading Loading @@ -2894,6 +2899,12 @@ TabChild::ReinitRendering() RefPtr<CompositorBridgeChild> cb = CompositorBridgeChild::Get(); // Refresh the compositor options since we may now be attached to a different // compositor than we were previously. CompositorOptions options; Unused << cb->SendGetCompositorOptions(mLayersId, &options); mCompositorOptions = Some(options); bool success; nsTArray<LayersBackend> ignored; PLayerTransactionChild* shadowManager = Loading dom/ipc/TabChild.h +6 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include "mozilla/EventForwards.h" #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/APZCCallbackHelper.h" #include "mozilla/layers/CompositorOptions.h" #include "nsIWebBrowserChrome3.h" #include "mozilla/dom/ipc/IdType.h" #include "AudioChannelService.h" Loading Loading @@ -617,7 +618,7 @@ public: return mParentIsActive; } bool AsyncPanZoomEnabled() const { return mAsyncPanZoomEnabled; } bool AsyncPanZoomEnabled() const; virtual ScreenIntSize GetInnerSize() override; Loading Loading @@ -776,6 +777,10 @@ private: LayoutDeviceIntPoint mChromeDisp; TabId mUniqueId; // Holds the compositor options for the compositor rendering this tab, // once we find out which compositor that is. Maybe<mozilla::layers::CompositorOptions> mCompositorOptions; friend class ContentChild; float mDPI; int32_t mRounding; Loading @@ -785,7 +790,6 @@ private: bool mIPCOpen; bool mParentIsActive; bool mAsyncPanZoomEnabled; CSSSize mUnscaledInnerSize; bool mDidSetRealShowInfo; bool mDidLoadURLInit; Loading gfx/layers/composite/LayerManagerComposite.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1409,7 +1409,7 @@ bool LayerManagerComposite::AsyncPanZoomEnabled() const { if (CompositorBridgeParent* bridge = mCompositor->GetCompositorBridgeParent()) { return bridge->AsyncPanZoomEnabled(); return bridge->GetOptions().UseAPZ(); } return false; } Loading gfx/layers/ipc/CompositorBridgeChild.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -1088,14 +1088,6 @@ CompositorBridgeChild::DeallocPCompositorWidgetChild(PCompositorWidgetChild* aAc #endif } bool CompositorBridgeChild::GetAPZEnabled(uint64_t aLayerTreeId) { bool result = false; Unused << SendAsyncPanZoomEnabled(aLayerTreeId, &result); return result; } PAPZCTreeManagerChild* CompositorBridgeChild::AllocPAPZCTreeManagerChild(const uint64_t& aLayersId) { Loading gfx/layers/ipc/CompositorBridgeChild.h +0 −2 Original line number Diff line number Diff line Loading @@ -221,8 +221,6 @@ public: PCompositorWidgetChild* AllocPCompositorWidgetChild(const CompositorWidgetInitData& aInitData) override; bool DeallocPCompositorWidgetChild(PCompositorWidgetChild* aActor) override; bool GetAPZEnabled(uint64_t aLayerTreeId); PAPZCTreeManagerChild* AllocPAPZCTreeManagerChild(const uint64_t& aLayersId) override; bool DeallocPAPZCTreeManagerChild(PAPZCTreeManagerChild* aActor) override; Loading Loading
dom/ipc/TabChild.cpp +21 −10 Original line number Diff line number Diff line Loading @@ -388,13 +388,6 @@ TabChild::TabChild(nsIContentChild* aManager, , mNativeWindowHandle(0) #endif { // In the general case having the TabParent tell us if APZ is enabled or not // doesn't really work because the TabParent itself may not have a reference // to the owning widget during initialization. Instead we assume that this // TabChild corresponds to a widget type that would have APZ enabled, and just // check the other conditions necessary for enabling APZ. mAsyncPanZoomEnabled = gfxPlatform::AsyncPanZoomEnabled(); nsWeakPtr weakPtrThis(do_GetWeakReference(static_cast<nsITabChild*>(this))); // for capture by the lambda mSetAllowedTouchBehaviorCallback = [weakPtrThis](uint64_t aInputBlockId, const nsTArray<TouchBehaviorFlags>& aFlags) Loading Loading @@ -431,6 +424,15 @@ TabChild::TabChild(nsIContentChild* aManager, } } bool TabChild::AsyncPanZoomEnabled() const { // If we have received the CompositorOptions we can answer definitively. If // not, return a best guess based on gfxPlaform values. return mCompositorOptions ? mCompositorOptions->UseAPZ() : gfxPlatform::AsyncPanZoomEnabled(); } NS_IMETHODIMP TabChild::Observe(nsISupports *aSubject, const char *aTopic, Loading Loading @@ -2502,6 +2504,10 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden return; } CompositorOptions options; Unused << compositorChild->SendGetCompositorOptions(aLayersId, &options); mCompositorOptions = Some(options); ShadowLayerForwarder* lf = mPuppetWidget->GetLayerManager( nullptr, mTextureFactoryIdentifier.mParentBackend) Loading Loading @@ -2550,11 +2556,10 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden void TabChild::InitAPZState() { auto cbc = CompositorBridgeChild::Get(); if (!cbc->GetAPZEnabled(mLayersId)) { if (!mCompositorOptions->UseAPZ()) { return; } auto cbc = CompositorBridgeChild::Get(); // Initialize the ApzcTreeManager. This takes multiple casts because of ugly multiple inheritance. PAPZCTreeManagerChild* baseProtocol = cbc->SendPAPZCTreeManagerConstructor(mLayersId); Loading Loading @@ -2894,6 +2899,12 @@ TabChild::ReinitRendering() RefPtr<CompositorBridgeChild> cb = CompositorBridgeChild::Get(); // Refresh the compositor options since we may now be attached to a different // compositor than we were previously. CompositorOptions options; Unused << cb->SendGetCompositorOptions(mLayersId, &options); mCompositorOptions = Some(options); bool success; nsTArray<LayersBackend> ignored; PLayerTransactionChild* shadowManager = Loading
dom/ipc/TabChild.h +6 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include "mozilla/EventForwards.h" #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/APZCCallbackHelper.h" #include "mozilla/layers/CompositorOptions.h" #include "nsIWebBrowserChrome3.h" #include "mozilla/dom/ipc/IdType.h" #include "AudioChannelService.h" Loading Loading @@ -617,7 +618,7 @@ public: return mParentIsActive; } bool AsyncPanZoomEnabled() const { return mAsyncPanZoomEnabled; } bool AsyncPanZoomEnabled() const; virtual ScreenIntSize GetInnerSize() override; Loading Loading @@ -776,6 +777,10 @@ private: LayoutDeviceIntPoint mChromeDisp; TabId mUniqueId; // Holds the compositor options for the compositor rendering this tab, // once we find out which compositor that is. Maybe<mozilla::layers::CompositorOptions> mCompositorOptions; friend class ContentChild; float mDPI; int32_t mRounding; Loading @@ -785,7 +790,6 @@ private: bool mIPCOpen; bool mParentIsActive; bool mAsyncPanZoomEnabled; CSSSize mUnscaledInnerSize; bool mDidSetRealShowInfo; bool mDidLoadURLInit; Loading
gfx/layers/composite/LayerManagerComposite.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1409,7 +1409,7 @@ bool LayerManagerComposite::AsyncPanZoomEnabled() const { if (CompositorBridgeParent* bridge = mCompositor->GetCompositorBridgeParent()) { return bridge->AsyncPanZoomEnabled(); return bridge->GetOptions().UseAPZ(); } return false; } Loading
gfx/layers/ipc/CompositorBridgeChild.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -1088,14 +1088,6 @@ CompositorBridgeChild::DeallocPCompositorWidgetChild(PCompositorWidgetChild* aAc #endif } bool CompositorBridgeChild::GetAPZEnabled(uint64_t aLayerTreeId) { bool result = false; Unused << SendAsyncPanZoomEnabled(aLayerTreeId, &result); return result; } PAPZCTreeManagerChild* CompositorBridgeChild::AllocPAPZCTreeManagerChild(const uint64_t& aLayersId) { Loading
gfx/layers/ipc/CompositorBridgeChild.h +0 −2 Original line number Diff line number Diff line Loading @@ -221,8 +221,6 @@ public: PCompositorWidgetChild* AllocPCompositorWidgetChild(const CompositorWidgetInitData& aInitData) override; bool DeallocPCompositorWidgetChild(PCompositorWidgetChild* aActor) override; bool GetAPZEnabled(uint64_t aLayerTreeId); PAPZCTreeManagerChild* AllocPAPZCTreeManagerChild(const uint64_t& aLayersId) override; bool DeallocPAPZCTreeManagerChild(PAPZCTreeManagerChild* aActor) override; Loading