зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1477551 - Ensure the clip and the rect that we push for bullets agree. r=jrmuizel
Using mPathRect causes rounding errors unnecessarily. Differential Revision: https://phabricator.services.mozilla.com/D5698
This commit is contained in:
Родитель
5692de863c
Коммит
2c251c4ab5
|
@ -371,6 +371,19 @@ static inline wr::ComplexClipRegion ToComplexClipRegion(const gfx::RoundedRect&
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline wr::ComplexClipRegion SimpleRadii(const wr::LayoutRect& aRect, float aRadii)
|
||||
{
|
||||
wr::ComplexClipRegion ret;
|
||||
wr::LayoutSize radii { aRadii, aRadii };
|
||||
ret.rect = aRect;
|
||||
ret.radii.top_left = radii;
|
||||
ret.radii.top_right = radii;
|
||||
ret.radii.bottom_left = radii;
|
||||
ret.radii.bottom_right = radii;
|
||||
ret.mode = wr::ClipMode::Clip;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline wr::LayoutSize ToLayoutSize(const mozilla::LayoutDeviceIntSize& size)
|
||||
{
|
||||
return ToLayoutSize(LayoutDeviceSize(size));
|
||||
|
|
|
@ -527,11 +527,8 @@ BulletRenderer::CreateWebRenderCommandsForPath(nsDisplayItem* aItem,
|
|||
return true;
|
||||
}
|
||||
case NS_STYLE_LIST_STYLE_DISC: {
|
||||
nsTArray<wr::ComplexClipRegion> clips;
|
||||
clips.AppendElement(wr::ToComplexClipRegion(
|
||||
RoundedRect(mPathRect.ToUnknownRect(),
|
||||
RectCornerRadii(dest.size.width / 2.0))
|
||||
));
|
||||
AutoTArray<wr::ComplexClipRegion, 1> clips;
|
||||
clips.AppendElement(wr::SimpleRadii(dest, dest.size.width / 2));
|
||||
auto clipId = aBuilder.DefineClip(Nothing(), dest, &clips, nullptr);
|
||||
aBuilder.PushClip(clipId);
|
||||
aBuilder.PushRect(dest, dest, isBackfaceVisible, color);
|
||||
|
|
Загрузка…
Ссылка в новой задаче