Skip to content

Commit

Permalink
Bug 1389143 - Send event regions override information to APZ in layer…
Browse files Browse the repository at this point in the history
…s-free mode. r=jrmuizel

MozReview-Commit-ID: 1jh6sdfe8jX

--HG--
extra : rebase_source : af35415e39a866b39db1edfd804c470fa3bec791
  • Loading branch information
staktrace committed Aug 18, 2017
1 parent dfc008e commit ecbda7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions gfx/layers/wr/WebRenderLayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ WebRenderLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback
// Make a "root" layer data that has everything else as descendants
mLayerScrollData.emplace_back();
mLayerScrollData.back().InitializeRoot(mLayerScrollData.size() - 1);
if (aDisplayListBuilder->IsBuildingLayerEventRegions()) {
nsIPresShell* shell = aDisplayListBuilder->RootReferenceFrame()->PresContext()->PresShell();
if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(shell)) {
mLayerScrollData.back().SetEventRegionsOverride(EventRegionsOverride::ForceDispatchToContent);
}
}
// Append the WebRenderLayerScrollData items into WebRenderScrollData
// in reverse order, from topmost to bottommost. This is in keeping with
// the semantics of WebRenderScrollData.
Expand Down
3 changes: 2 additions & 1 deletion gfx/layers/wr/WebRenderScrollData.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ class WebRenderLayerScrollData

void AddEventRegions(const EventRegions& aRegions) { mEventRegions.OrWith(aRegions); }
EventRegions GetEventRegions() const { return mEventRegions; }
void SetEventRegionsOverride(const EventRegionsOverride& aOverride) { mEventRegionsOverride = aOverride; }
EventRegionsOverride GetEventRegionsOverride() const { return mEventRegionsOverride; }

const LayerIntRegion& GetVisibleRegion() const { return mVisibleRegion; }
void SetReferentId(uint64_t aReferentId) { mReferentId = Some(aReferentId); }
Maybe<uint64_t> GetReferentId() const { return mReferentId; }
EventRegionsOverride GetEventRegionsOverride() const { return mEventRegionsOverride; }

void SetScrollThumbData(const ScrollThumbData& aData) { mScrollThumbData = aData; }
const ScrollThumbData& GetScrollThumbData() const { return mScrollThumbData; }
Expand Down
1 change: 1 addition & 0 deletions layout/ipc/RenderFrameParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ nsDisplayRemote::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
if (aLayerData) {
aLayerData->SetReferentId(GetRemoteLayersId());
aLayerData->SetTransform(mozilla::gfx::Matrix4x4::Translation(mOffset.x, mOffset.y, 0.0));
aLayerData->SetEventRegionsOverride(mEventRegionsOverride);
}
return true;
}
Expand Down

0 comments on commit ecbda7b

Please sign in to comment.