Skip to content

Commit

Permalink
Bug 1503447 - Remove the clip->ASR == item->ASR hacky code path r=kats
Browse files Browse the repository at this point in the history
Previously, WebRender ignored clip_node_id on the clip/scroll stack
when pushing clips or reference frames. This got fixed to be more consistent in:
servo/webrender#3315

Now Gecko can use the clip chains generated for display items naturally,
instead of smuggling the last clip through the scroll_node_id, which is what
was happening in this hacky code branch being removed.

Differential Revision: https://phabricator.services.mozilla.com/D12216

UltraBlame original commit: aa0c5bc2a99ee57f82ca44da461ebd9870af4275
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent 216af16 commit c635a67
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions gfx/layers/wr/ClipManager.cpp
Expand Up @@ -101,7 +101,7 @@ ClipManager::PushOverrideForASR(const ActiveScrolledRoot* aASR,
MOZ_ASSERT(scrollId.isSome());

CLIP_LOG("Pushing override %zu -> %s\n", scrollId->id,
Stringify(aClipId->id).c_str());
Stringify(aClipId.id).c_str());
auto it = mASROverride.insert({ *scrollId, std::stack<wr::WrClipId>() });
it.first->second.push(aClipId);

Expand All @@ -122,7 +122,7 @@ ClipManager::PopOverrideForASR(const ActiveScrolledRoot* aASR)
MOZ_ASSERT(it != mASROverride.end());
MOZ_ASSERT(!(it->second.empty()));
CLIP_LOG("Popping override %zu -> %s\n", scrollId->id,
Stringify(it->second.top()->id).c_str());
Stringify(it->second.top().id).c_str());
it->second.pop();
if (it->second.empty()) {
mASROverride.erase(it);
Expand All @@ -141,7 +141,7 @@ ClipManager::ClipIdAfterOverride(const Maybe<wr::WrClipId>& aClipId)
}
MOZ_ASSERT(!it->second.empty());
CLIP_LOG("Overriding %zu with %s\n", aClipId->id,
it->second.top() ? Stringify(it->second.top()->id).c_str() : "(none)");
Stringify(it->second.top().id).c_str());
return Some(it->second.top());
}

Expand Down Expand Up @@ -231,26 +231,7 @@ ClipManager::BeginItem(nsDisplayItem* aItem,

clips.mClipChainId = DefineClipChain(clip, auPerDevPixel, aStackingContext);

if (clip && clip->mASR == asr) {














const ClipIdMap& cache = mCacheStack.top();
auto it = cache.find(clip);
MOZ_ASSERT(it != cache.end());
clips.mScrollId = Some(it->second);
} else if (clip) {
if (clip) {


Maybe<wr::WrClipId> scrollId = GetScrollLayer(asr);
Expand Down

0 comments on commit c635a67

Please sign in to comment.