зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1775188 - Remove direct use of ClipId on stacking contexts r=gfx-reviewers,lsalzman
In future, stacking contexts, hit-tests and prims will all use clip-chains rather than the old-style ClipId references. Differential Revision: https://phabricator.services.mozilla.com/D149844
This commit is contained in:
Родитель
fdd6afc666
Коммит
d784bfaee9
|
@ -134,7 +134,6 @@ impl WrSpaceAndClipChain {
|
|||
#[repr(C)]
|
||||
pub enum WrStackingContextClip {
|
||||
None,
|
||||
ClipId(WrClipId),
|
||||
ClipChain(u64),
|
||||
}
|
||||
|
||||
|
@ -143,7 +142,6 @@ impl WrStackingContextClip {
|
|||
match *self {
|
||||
WrStackingContextClip::None => None,
|
||||
WrStackingContextClip::ClipChain(id) => Some(clip_chain_id_to_webrender(id, pipeline_id)),
|
||||
WrStackingContextClip::ClipId(id) => Some(id.to_webrender(pipeline_id)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8015,7 +8015,7 @@ void nsDisplayMasksAndClipPaths::Paint(nsDisplayListBuilder* aBuilder,
|
|||
});
|
||||
}
|
||||
|
||||
static Maybe<wr::WrClipId> CreateSimpleClipRegion(
|
||||
static Maybe<wr::WrClipChainId> CreateSimpleClipRegion(
|
||||
const nsDisplayMasksAndClipPaths& aDisplayItem,
|
||||
wr::DisplayListBuilder& aBuilder) {
|
||||
nsIFrame* frame = aDisplayItem.Frame();
|
||||
|
@ -8091,7 +8091,9 @@ static Maybe<wr::WrClipId> CreateSimpleClipRegion(
|
|||
return Nothing();
|
||||
}
|
||||
|
||||
return Some(clipId);
|
||||
wr::WrClipChainId clipChainId = aBuilder.DefineClipChain({clipId}, true);
|
||||
|
||||
return Some(clipChainId);
|
||||
}
|
||||
|
||||
static void FillPolygonDataForDisplayItem(
|
||||
|
@ -8131,7 +8133,7 @@ static void FillPolygonDataForDisplayItem(
|
|||
: wr::FillRule::Evenodd;
|
||||
}
|
||||
|
||||
static Maybe<wr::WrClipId> CreateWRClipPathAndMasks(
|
||||
static Maybe<wr::WrClipChainId> CreateWRClipPathAndMasks(
|
||||
nsDisplayMasksAndClipPaths* aDisplayItem, const LayoutDeviceRect& aBounds,
|
||||
wr::IpcResourceUpdateQueue& aResources, wr::DisplayListBuilder& aBuilder,
|
||||
const StackingContextHelper& aSc, RenderRootStateManager* aManager,
|
||||
|
@ -8155,7 +8157,9 @@ static Maybe<wr::WrClipId> CreateWRClipPathAndMasks(
|
|||
wr::WrClipId clipId =
|
||||
aBuilder.DefineImageMaskClip(mask.ref(), points, fillRule);
|
||||
|
||||
return Some(clipId);
|
||||
wr::WrClipChainId clipChainId = aBuilder.DefineClipChain({clipId}, true);
|
||||
|
||||
return Some(clipChainId);
|
||||
}
|
||||
|
||||
bool nsDisplayMasksAndClipPaths::CreateWebRenderCommands(
|
||||
|
@ -8168,7 +8172,7 @@ bool nsDisplayMasksAndClipPaths::CreateWebRenderCommands(
|
|||
LayoutDeviceRect bounds =
|
||||
LayoutDeviceRect::FromAppUnits(displayBounds, appUnitsPerDevPixel);
|
||||
|
||||
Maybe<wr::WrClipId> clip = CreateWRClipPathAndMasks(
|
||||
Maybe<wr::WrClipChainId> clip = CreateWRClipPathAndMasks(
|
||||
this, bounds, aResources, aBuilder, aSc, aManager, aDisplayListBuilder);
|
||||
|
||||
float oldOpacity = aBuilder.GetInheritedOpacity();
|
||||
|
@ -8189,7 +8193,7 @@ bool nsDisplayMasksAndClipPaths::CreateWebRenderCommands(
|
|||
: Nothing();
|
||||
|
||||
wr::StackingContextParams params;
|
||||
params.clip = wr::WrStackingContextClip::ClipId(*clip);
|
||||
params.clip = wr::WrStackingContextClip::ClipChain(clip->id);
|
||||
params.opacity = opacity.ptrOr(nullptr);
|
||||
if (mWrapsBackdropFilter) {
|
||||
params.flags |= wr::StackingContextFlags::WRAPS_BACKDROP_FILTER;
|
||||
|
@ -8428,16 +8432,18 @@ bool nsDisplayFilters::CreateWebRenderCommands(
|
|||
return true;
|
||||
}
|
||||
|
||||
wr::WrStackingContextClip clip{};
|
||||
uint64_t clipChainId;
|
||||
if (filterClip) {
|
||||
auto devPxRect = LayoutDeviceRect::FromAppUnits(
|
||||
filterClip.value() + ToReferenceFrame(), auPerDevPixel);
|
||||
wr::WrClipId clipId =
|
||||
auto clipId =
|
||||
aBuilder.DefineRectClip(Nothing(), wr::ToLayoutRect(devPxRect));
|
||||
clip = wr::WrStackingContextClip::ClipId(clipId);
|
||||
clipChainId = aBuilder.DefineClipChain({clipId}, true).id;
|
||||
} else {
|
||||
clip = wr::WrStackingContextClip::ClipChain(aBuilder.CurrentClipChainId());
|
||||
clipChainId = aBuilder.CurrentClipChainId();
|
||||
}
|
||||
wr::WrStackingContextClip clip =
|
||||
wr::WrStackingContextClip::ClipChain(clipChainId);
|
||||
|
||||
float opacity = aBuilder.GetInheritedOpacity();
|
||||
aBuilder.SetInheritedOpacity(1.0f);
|
||||
|
|
Загрузка…
Ссылка в новой задаче