Bug 1454042 - Allow missing pipeline information for cross-process iframes. r?sotaro
We should always have the pipeline information for in-process things like
async images, but for cross-process iframes we might not have the information
right away if the content process doesn't get around to sending it for a while.
MozReview-Commit-ID: 18F5nqilXoV
--- a/gfx/layers/wr/WebRenderUserData.cpp
+++ b/gfx/layers/wr/WebRenderUserData.cpp
@@ -209,17 +209,17 @@ WebRenderImageData::CreateAsyncImageWebR
//
// We don't push a stacking context for this async image pipeline here.
// Instead, we do it inside the iframe that hosts the image. As a 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 AsyncImagePipelineManager.
wr::LayoutRect r = wr::ToRoundedLayoutRect(aBounds);
- aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref());
+ aBuilder.PushIFrame(r, aIsBackfaceVisible, mPipelineId.ref(), /*ignoreMissingPipelines*/ false);
WrBridge()->AddWebRenderParentCommand(OpUpdateAsyncImagePipeline(mPipelineId.value(),
aSCBounds,
aSCTransform,
aScaleToSize,
aFilter,
aMixBlendMode));
}
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -1078,19 +1078,20 @@ DisplayListBuilder::PushYCbCrInterleaved
aImageChannel0,
aColorSpace,
aRendering);
}
void
DisplayListBuilder::PushIFrame(const wr::LayoutRect& aBounds,
bool aIsBackfaceVisible,
- PipelineId aPipeline)
+ PipelineId aPipeline,
+ bool aIgnoreMissingPipeline)
{
- wr_dp_push_iframe(mWrState, aBounds, aIsBackfaceVisible, aPipeline);
+ wr_dp_push_iframe(mWrState, aBounds, aIsBackfaceVisible, aPipeline, aIgnoreMissingPipeline);
}
void
DisplayListBuilder::PushBorder(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::BorderWidths& aWidths,
const Range<const wr::BorderSide>& aSides,
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -387,17 +387,18 @@ public:
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
wr::ImageKey aImageChannel0,
wr::WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushIFrame(const wr::LayoutRect& aBounds,
bool aIsBackfaceVisible,
- wr::PipelineId aPipeline);
+ wr::PipelineId aPipeline,
+ bool aIgnoreMissingPipeline);
// XXX WrBorderSides are passed with Range.
// It is just to bypass compiler bug. See Bug 1357734.
void PushBorder(const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip,
bool aIsBackfaceVisible,
const wr::BorderWidths& aWidths,
const Range<const wr::BorderSide>& aSides,
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1857,23 +1857,24 @@ pub extern "C" fn wr_dp_pop_clip_and_scr
debug_assert!(unsafe { is_in_main_thread() });
state.frame_builder.dl_builder.pop_clip_id();
}
#[no_mangle]
pub extern "C" fn wr_dp_push_iframe(state: &mut WrState,
rect: LayoutRect,
is_backface_visible: bool,
- pipeline_id: WrPipelineId) {
+ pipeline_id: WrPipelineId,
+ ignore_missing_pipeline: bool) {
debug_assert!(unsafe { is_in_main_thread() });
let mut prim_info = LayoutPrimitiveInfo::new(rect);
prim_info.is_backface_visible = is_backface_visible;
prim_info.tag = state.current_tag;
- state.frame_builder.dl_builder.push_iframe(&prim_info, pipeline_id, true);
+ state.frame_builder.dl_builder.push_iframe(&prim_info, pipeline_id, ignore_missing_pipeline);
}
#[no_mangle]
pub extern "C" fn wr_dp_push_rect(state: &mut WrState,
rect: LayoutRect,
clip: LayoutRect,
is_backface_visible: bool,
color: ColorF) {
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1238,17 +1238,18 @@ void wr_dp_push_clip_and_scroll_info(WrS
uintptr_t aScrollId,
const uint64_t *aClipChainId)
WR_FUNC;
WR_INLINE
void wr_dp_push_iframe(WrState *aState,
LayoutRect aRect,
bool aIsBackfaceVisible,
- WrPipelineId aPipelineId)
+ WrPipelineId aPipelineId,
+ bool aIgnoreMissingPipeline)
WR_FUNC;
WR_INLINE
void wr_dp_push_image(WrState *aState,
LayoutRect aBounds,
LayoutRect aClip,
bool aIsBackfaceVisible,
LayoutSize aStretchSize,
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -168,17 +168,17 @@ public:
// We don't push a stacking context for this async image pipeline here.
// Instead, we do it inside the iframe that hosts the image. As a 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::ToRoundedLayoutRect(bounds);
- aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref());
+ aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref(), /*ignoreMissingPipelines*/ false);
gfx::Matrix4x4 scTransform;
gfxRect destGFXRect = mFrame->PresContext()->AppUnitsToGfxUnits(dest);
scTransform.PreScale(destGFXRect.Width() / canvasSizeInPx.width,
destGFXRect.Height() / canvasSizeInPx.height, 1.0f);
if (data->NeedsYFlip()) {
scTransform = scTransform.PreTranslate(0, data->GetSize().height, 0).PreScale(1, -1, 1);
}
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -385,17 +385,18 @@ nsDisplayRemote::CreateWebRenderCommands
mOffset = mozilla::layout::GetContentRectLayerOffset(mFrame, aDisplayListBuilder);
mozilla::LayoutDeviceRect rect = mozilla::LayoutDeviceRect::FromAppUnits(
mFrame->GetContentRectRelativeToSelf(), mFrame->PresContext()->AppUnitsPerDevPixel());
rect += mOffset;
aBuilder.PushIFrame(mozilla::wr::ToRoundedLayoutRect(rect),
!BackfaceIsHidden(),
- mozilla::wr::AsPipelineId(GetRemoteLayersId()));
+ mozilla::wr::AsPipelineId(GetRemoteLayersId()),
+ /*ignoreMissingPipelines*/ true);
return true;
}
bool
nsDisplayRemote::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
mozilla::layers::WebRenderLayerScrollData* aLayerData)
{