Bug 1614655 - Part 3: Retain WR display items for nsDisplayBorder, nsDisplayText, nsDisplayButtonBorder, and nsDisplayButtonForeground r=jrmuizel

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Miko Mynttinen 2020-03-18 23:47:34 +00:00
Родитель ba0e838277
Коммит 3ccee006fc
2 изменённых файлов: 26 добавлений и 3 удалений

Просмотреть файл

@ -232,6 +232,7 @@ bool nsDisplayButtonBorder::CreateWebRenderCommands(
nsDisplayListBuilder* aDisplayListBuilder) {
// This is really a combination of paint box shadow inner +
// paint border.
aBuilder.StartGroup(this);
const nsRect buttonRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
bool snap;
nsRegion visible = GetBounds(aDisplayListBuilder, &snap);
@ -244,11 +245,17 @@ bool nsDisplayButtonBorder::CreateWebRenderCommands(
nsRect(ToReferenceFrame(), mFrame->GetSize()), mFrame->Style(),
&borderIsEmpty, mFrame->GetSkipSides());
if (!br) {
if (borderIsEmpty) {
aBuilder.FinishGroup();
} else {
aBuilder.CancelGroup();
}
return borderIsEmpty;
}
br->CreateWebRenderCommands(this, aBuilder, aResources, aSc);
aBuilder.FinishGroup();
return true;
}
@ -373,7 +380,10 @@ bool nsDisplayButtonForeground::CreateWebRenderCommands(
return borderIsEmpty;
}
aBuilder.StartGroup(this);
br->CreateWebRenderCommands(this, aBuilder, aResources, aSc);
aBuilder.FinishGroup();
return true;
}

Просмотреть файл

@ -5693,14 +5693,18 @@ bool nsDisplayBorder::CreateWebRenderCommands(
nsDisplayListBuilder* aDisplayListBuilder) {
nsRect rect = nsRect(ToReferenceFrame(), mFrame->GetSize());
aBuilder.StartGroup(this);
ImgDrawResult drawResult = nsCSSRendering::CreateWebRenderCommandsForBorder(
this, mFrame, rect, aBuilder, aResources, aSc, aManager,
aDisplayListBuilder);
if (drawResult == ImgDrawResult::NOT_SUPPORTED) {
aBuilder.CancelGroup();
return false;
}
aBuilder.FinishGroup();
nsDisplayBorderGeometry::UpdateDrawResult(this, drawResult);
return true;
};
@ -9539,9 +9543,18 @@ bool nsDisplayText::CreateWebRenderCommands(
RefPtr<gfxContext> textDrawer = aBuilder.GetTextContext(
aResources, aSc, aManager, this, bounds, deviceOffset);
RenderToContext(textDrawer, aDisplayListBuilder, true);
aBuilder.StartGroup(this);
return textDrawer->GetTextDrawer()->Finish();
RenderToContext(textDrawer, aDisplayListBuilder, true);
const bool result = textDrawer->GetTextDrawer()->Finish();
if (result) {
aBuilder.FinishGroup();
} else {
aBuilder.CancelGroup();
}
return result;
}
void nsDisplayText::RenderToContext(gfxContext* aCtx,