Bug 1247082 - Suppress rendering of nsBackdropFrame for VR content r=dholbert

- The VR specific render path in ContainerLayerComposite does not
  handle nsBackdropFrame correctly, resulting in a alternate frame
  strobing effect in the Oculus Headset.  As VR content is composed
  of a Canvas element that is scaled to the extents of the surface,
  the backdrop would otherwise not have an effect for VR content,
  which means we can simply suppress the backdrop.

MozReview-Commit-ID: 3bCTOApiH8E

--HG--
extra : rebase_source : 015e15dee2ac3235e1e571642d3988b66b97dfd1
This commit is contained in:
kearwood 2016-02-12 11:14:05 -08:00
parent 83164e2591
commit b1d8c6f915

View File

@ -45,10 +45,22 @@ nsBackdropFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// none or contents so that we can respond to style change on it. To
// support those values, we skip painting ourselves in those cases.
auto display = StyleDisplay()->mDisplay;
if (display != NS_STYLE_DISPLAY_NONE &&
display != NS_STYLE_DISPLAY_CONTENTS) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
if (display == NS_STYLE_DISPLAY_NONE ||
display == NS_STYLE_DISPLAY_CONTENTS) {
return;
}
// The WebVR specific render path in nsContainerLayerComposite
// results in an alternating frame strobing effect when an nsBackdropFrame is
// rendered.
// Currently, VR content is composed of a fullscreen canvas element that
// is expected to cover the entire viewport so a backdrop should not
// be necessary.
if (GetStateBits() & NS_FRAME_HAS_VR_CONTENT) {
return;
}
DisplayBorderBackgroundOutline(aBuilder, aLists);
}
/* virtual */ LogicalSize