author | Kartikaya Gupta <kgupta@mozilla.com> |
Wed, 26 Jul 2017 14:47:48 -0400 | |
changeset 371233 | 3a1dfb72b22525011e741e4c51700151155932a7 |
parent 371232 | b298cd21c0f1850caabd581b3d34b003d05384b8 |
child 371234 | 691af1e600e06fcee33478a39d03c43a24c5d2e8 |
push id | 93049 |
push user | cbook@mozilla.com |
push date | Thu, 27 Jul 2017 09:30:07 +0000 |
treeherder | mozilla-inbound@5e9f7561c2eb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jrmuizel |
bugs | 1384181 |
milestone | 56.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -240,16 +240,17 @@ WebRenderLayerManager::CreateWebRenderCo if (apzEnabled) { bool forceNewLayerData = false; // For some types of display items we want to force a new // WebRenderLayerScrollData object, to ensure we preserve the APZ-relevant // data that is in the display item. switch (itemType) { case nsDisplayItem::TYPE_SCROLL_INFO_LAYER: + case nsDisplayItem::TYPE_REMOTE: forceNewLayerData = true; break; default: break; } // Anytime the ASR changes we also want to force a new layer data because // the stack of scroll metadata is going to be different for this
--- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -1,18 +1,18 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/layers/WebRenderScrollData.h" #include "Layers.h" +#include "mozilla/layout/RenderFrameParent.h" #include "mozilla/Unused.h" -#include "Layers.h" #include "nsTArray.h" #include "UnitTransforms.h" namespace mozilla { namespace layers { WebRenderLayerScrollData::WebRenderLayerScrollData() : mDescendantCount(-1) @@ -68,23 +68,33 @@ WebRenderLayerScrollData::InitializeRoot void WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner, nsDisplayItem* aItem) { mDescendantCount = 0; MOZ_ASSERT(aItem); - if (aItem->GetType() == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) { + switch (aItem->GetType()) { + case nsDisplayItem::TYPE_SCROLL_INFO_LAYER: { nsDisplayScrollInfoLayer* info = static_cast<nsDisplayScrollInfoLayer*>(aItem); UniquePtr<ScrollMetadata> metadata = info->ComputeScrollMetadata( nullptr, ContainerLayerParameters()); MOZ_ASSERT(metadata); MOZ_ASSERT(metadata->GetMetrics().IsScrollInfoLayer()); mScrollIds.AppendElement(aOwner.AddMetadata(*metadata)); + break; + } + case nsDisplayItem::TYPE_REMOTE: { + nsDisplayRemote* remote = static_cast<nsDisplayRemote*>(aItem); + mReferentId = Some(remote->GetRemoteLayersId()); + break; + } + default: + break; } for (const ActiveScrolledRoot* asr = aItem->GetActiveScrolledRoot(); asr; asr = asr->mParent) { Maybe<ScrollMetadata> metadata = asr->mScrollableFrame->ComputeScrollMetadata( nullptr, aItem->ReferenceFrame(), ContainerLayerParameters(), nullptr); MOZ_ASSERT(metadata); mScrollIds.AppendElement(aOwner.AddMetadata(metadata.ref()));
--- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -390,12 +390,18 @@ nsDisplayRemote::CreateWebRenderCommands { MOZ_ASSERT(aManager->IsLayersFreeTransaction()); mozilla::LayoutDeviceRect visible = mozilla::LayoutDeviceRect::FromAppUnits( GetVisibleRect(), mFrame->PresContext()->AppUnitsPerDevPixel()); visible += mozilla::layout::GetContentRectLayerOffset(mFrame, aDisplayListBuilder); aBuilder.PushIFrame(aSc.ToRelativeLayoutRect(visible), - mozilla::wr::AsPipelineId(mRemoteFrame->GetLayersId())); + mozilla::wr::AsPipelineId(GetRemoteLayersId())); return true; } + +uint64_t +nsDisplayRemote::GetRemoteLayersId() const +{ + return mRemoteFrame->GetLayersId(); +}
--- a/layout/ipc/RenderFrameParent.h +++ b/layout/ipc/RenderFrameParent.h @@ -162,16 +162,17 @@ public: BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) override; virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder, const StackingContextHelper& aSc, nsTArray<WebRenderParentCommand>& aParentCommands, mozilla::layers::WebRenderLayerManager* aManager, nsDisplayListBuilder* aDisplayListBuilder) override; + uint64_t GetRemoteLayersId() const; NS_DISPLAY_DECL_NAME("Remote", TYPE_REMOTE) private: RenderFrameParent* mRemoteFrame; mozilla::layers::EventRegionsOverride mEventRegionsOverride; };