Bug 1792285 - Part 1: Refactor `DisplayListBuilder::PushIFrame` in preparation for proper subpixel snapping. r=emilio

Incoming `bounds` parameter is now `LayoutDeviceRect` in preparation for
proper subpixel snapping.

Differential Revision: https://phabricator.services.mozilla.com/D159884
This commit is contained in:
David Shin 2022-11-01 20:32:06 +00:00
Родитель 4bba6dade3
Коммит 96cf231f1f
5 изменённых файлов: 11 добавлений и 13 удалений

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

@ -225,8 +225,7 @@ void WebRenderImageData::CreateAsyncImageWebRenderCommands(
// context need to be done manually and pushed over to the parent side,
// where it will be done when we build the display list for the iframe.
// That happens in AsyncImagePipelineManager.
wr::LayoutRect r = wr::ToLayoutRect(aBounds);
aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref(),
aBuilder.PushIFrame(aBounds, aIsBackfaceVisible, mPipelineId.ref(),
/*ignoreMissingPipelines*/ false);
WrBridge()->AddWebRenderParentCommand(OpUpdateAsyncImagePipeline(
@ -335,8 +334,7 @@ void WebRenderInProcessImageData::CreateWebRenderCommands(
// context need to be done manually and pushed over to the parent side,
// where it will be done when we build the display list for the iframe.
// That happens in AsyncImagePipelineManager.
wr::LayoutRect r = wr::ToLayoutRect(aBounds);
aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref(),
aBuilder.PushIFrame(aBounds, aIsBackfaceVisible, mPipelineId.ref(),
/*ignoreMissingPipelines*/ false);
WrBridge()->AddWebRenderParentCommand(OpUpdateAsyncImagePipeline(

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

@ -1370,13 +1370,14 @@ void DisplayListBuilder::PushYCbCrInterleavedImage(
aSupportsExternalCompositing);
}
void DisplayListBuilder::PushIFrame(const wr::LayoutRect& aBounds,
void DisplayListBuilder::PushIFrame(const LayoutDeviceRect& aDevPxBounds,
bool aIsBackfaceVisible,
PipelineId aPipeline,
bool aIgnoreMissingPipeline) {
mRemotePipelineIds.AppendElement(aPipeline);
wr_dp_push_iframe(mWrState, aBounds, MergeClipLeaf(aBounds),
aIsBackfaceVisible, &mCurrentSpaceAndClipChain, aPipeline,
const auto bounds = wr::ToLayoutRect(aDevPxBounds);
wr_dp_push_iframe(mWrState, bounds, MergeClipLeaf(bounds), aIsBackfaceVisible,
&mCurrentSpaceAndClipChain, aPipeline,
aIgnoreMissingPipeline);
}

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

@ -577,7 +577,7 @@ class DisplayListBuilder final {
bool aPreferCompositorSurface = false,
bool aSupportsExternalCompositing = false);
void PushIFrame(const wr::LayoutRect& aBounds, bool aIsBackfaceVisible,
void PushIFrame(const LayoutDeviceRect& aDevPxBounds, bool aIsBackfaceVisible,
wr::PipelineId aPipeline, bool aIgnoreMissingPipeline);
// XXX WrBorderSides are passed with Range.

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

@ -181,10 +181,9 @@ class nsDisplayCanvas final : public nsPaintedDisplayItem {
// result, a bunch of the calculations normally done as part of that
// stacking context need to be done manually and pushed over to the
// parent side, where it will be done when we build the display list for
// the iframe. That happens in WebRenderCompositableHolder.
wr::LayoutRect r = wr::ToLayoutRect(bounds);
aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref(),
// the iframe. That happens in WebRenderCompositableHolder.s2);
aBuilder.PushIFrame(bounds, !BackfaceIsHidden(),
data->GetPipelineId().ref(),
/*ignoreMissingPipelines*/ false);
LayoutDeviceRect scBounds(LayoutDevicePoint(0, 0), bounds.Size());

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

@ -1413,7 +1413,7 @@ bool nsDisplayRemote::CreateWebRenderCommands(
auto rect = LayoutDeviceRect::FromAppUnits(destRect, auPerDevPixel);
rect += mOffset;
aBuilder.PushIFrame(mozilla::wr::ToLayoutRect(rect), !BackfaceIsHidden(),
aBuilder.PushIFrame(rect, !BackfaceIsHidden(),
mozilla::wr::AsPipelineId(mPaintData.mLayersId),
/*ignoreMissingPipelines*/ true);