Backed out 3 changesets (bug 1664804) for high frequent failures at APZCTreeManager.cpp. CLOSED TREE

Backed out changeset 3d03dbc5ab3f (bug 1664804)
Backed out changeset cdc14c572652 (bug 1664804)
Backed out changeset aba3cff2d5dd (bug 1664804)
This commit is contained in:
Razvan Maries 2020-10-15 03:35:32 +03:00
Родитель d5c48f0477
Коммит 1677e557a4
6 изменённых файлов: 21 добавлений и 89 удалений

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

@ -126,9 +126,6 @@ void ShareableCanvasRenderer::UpdateCompositableClient() {
if (!YIsDown()) {
flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
}
if (IsOpaque()) {
flags |= TextureFlags::IS_OPAQUE;
}
// -

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

@ -229,13 +229,11 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
case gfx::SurfaceFormat::B8G8R8X8: {
MOZ_ASSERT(aImageKeys.length() == 1);
MOZ_ASSERT(mSurface->GetPlaneCount() == 0);
// We disable external compositing for RGB surfaces for now until
// we've tested support more thoroughly. Bug 1667917.
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
preferCompositorSurface,
/* aSupportsExternalCompositing */ false);
/* aSupportsExternalCompositing */ true);
break;
}
case gfx::SurfaceFormat::YUV422: {

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

@ -113,46 +113,8 @@ static void BuildDisplayListForTopLayerFrame(nsDisplayListBuilder* aBuilder,
aList->AppendToTop(&list);
}
static bool BackdropListIsOpaque(ViewportFrame* aFrame,
nsDisplayListBuilder* aBuilder,
nsDisplayList* aList) {
// The common case for ::backdrop elements on the top layer is a single
// fixed position container, holding an opaque background color covering
// the whole viewport.
if (aList->Count() != 1 ||
aList->GetTop()->GetType() != DisplayItemType::TYPE_FIXED_POSITION) {
return false;
}
// Make sure the fixed position container isn't clipped or scrollable.
nsDisplayFixedPosition* fixed =
static_cast<nsDisplayFixedPosition*>(aList->GetTop());
if (fixed->GetActiveScrolledRoot() || fixed->GetClipChain()) {
return false;
}
nsDisplayList* children = fixed->GetChildren();
if (!children->GetTop() ||
children->GetTop()->GetType() != DisplayItemType::TYPE_BACKGROUND_COLOR) {
return false;
}
nsDisplayBackgroundColor* child =
static_cast<nsDisplayBackgroundColor*>(children->GetTop());
if (child->GetActiveScrolledRoot() || child->GetClipChain()) {
return false;
}
// Check that the background color is both opaque, and covering the
// whole viewport.
bool dummy;
nsRegion opaque = child->GetOpaqueRegion(aBuilder, &dummy);
return opaque.Contains(aFrame->GetRect());
}
void ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList,
bool* aIsOpaque) {
nsDisplayList* aList) {
nsTArray<dom::Element*> topLayer = PresContext()->Document()->GetTopLayer();
for (dom::Element* elem : topLayer) {
if (nsIFrame* frame = elem->GetPrimaryFrame()) {
@ -190,10 +152,6 @@ void ViewportFrame::BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
static_cast<nsPlaceholderFrame*>(backdropPh)->GetOutOfFlowFrame();
MOZ_ASSERT(backdropFrame);
BuildDisplayListForTopLayerFrame(aBuilder, backdropFrame, aList);
if (aIsOpaque) {
*aIsOpaque = BackdropListIsOpaque(this, aBuilder, aList);
}
}
BuildDisplayListForTopLayerFrame(aBuilder, frame, aList);
}

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

@ -52,8 +52,7 @@ class ViewportFrame : public nsContainerFrame {
const nsDisplayListSet& aLists) override;
void BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList,
bool* aIsOpaque = nullptr);
nsDisplayList* aList);
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;

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

@ -3637,36 +3637,28 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
bool addScrollBars =
mIsRoot && mWillBuildScrollableLayer && aBuilder->IsPaintingToWindow();
nsDisplayListCollection set(aBuilder);
if (addScrollBars) {
// Add classic scrollbars.
AppendScrollPartsTo(aBuilder, set, createLayersForScrollbars, false);
AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, false);
}
nsDisplayListBuilder::AutoBuildingDisplayList building(
aBuilder, mOuter, visibleRect, dirtyRect);
{
nsDisplayListBuilder::AutoBuildingDisplayList building(
aBuilder, mOuter, visibleRect, dirtyRect);
// Don't clip the scrolled child, and don't paint scrollbars/scrollcorner.
// The scrolled frame shouldn't have its own background/border, so we
// can just pass aLists directly.
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, set);
bool topLayerIsOpaque = false;
if (nsDisplayWrapList* topLayerWrapList =
MaybeCreateTopLayerItems(aBuilder, &topLayerIsOpaque)) {
if (topLayerIsOpaque) {
set.DeleteAll(aBuilder);
}
set.PositionedDescendants()->AppendToTop(topLayerWrapList);
// Don't clip the scrolled child, and don't paint scrollbars/scrollcorner.
// The scrolled frame shouldn't have its own background/border, so we
// can just pass aLists directly.
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, aLists);
}
MaybeAddTopLayerItems(aBuilder, aLists);
if (addScrollBars) {
// Add overlay scrollbars.
AppendScrollPartsTo(aBuilder, set, createLayersForScrollbars, true);
AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, true);
}
set.MoveTo(aLists);
return;
}
@ -3965,17 +3957,7 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
// Create any required items for the 'top layer' and check if they'll be
// opaque over the entire area of the viewport. If they are, then we can
// skip building display items for the rest of the page.
bool topLayerIsOpaque = false;
if (nsDisplayWrapList* topLayerWrapList =
MaybeCreateTopLayerItems(aBuilder, &topLayerIsOpaque)) {
if (topLayerIsOpaque) {
set.DeleteAll(aBuilder);
}
set.PositionedDescendants()->AppendToTop(topLayerWrapList);
}
MaybeAddTopLayerItems(aBuilder, set);
if (willBuildAsyncZoomContainer) {
MOZ_ASSERT(mClipAllDescendants);
@ -4078,13 +4060,12 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
scrolledContent.MoveTo(aLists);
}
nsDisplayWrapList* ScrollFrameHelper::MaybeCreateTopLayerItems(
nsDisplayListBuilder* aBuilder, bool* aIsOpaque) {
void ScrollFrameHelper::MaybeAddTopLayerItems(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
if (mIsRoot) {
if (ViewportFrame* viewportFrame = do_QueryFrame(mOuter->GetParent())) {
nsDisplayList topLayerList;
viewportFrame->BuildDisplayListForTopLayer(aBuilder, &topLayerList,
aIsOpaque);
viewportFrame->BuildDisplayListForTopLayer(aBuilder, &topLayerList);
if (!topLayerList.IsEmpty()) {
nsDisplayListBuilder::AutoBuildingDisplayList buildingDisplayList(
aBuilder, viewportFrame);
@ -4098,12 +4079,11 @@ nsDisplayWrapList* ScrollFrameHelper::MaybeCreateTopLayerItems(
if (wrapList) {
wrapList->SetOverrideZIndex(
std::numeric_limits<decltype(wrapList->ZIndex())>::max());
return wrapList;
aLists.PositionedDescendants()->AppendToTop(wrapList);
}
}
}
}
return nullptr;
}
nsRect ScrollFrameHelper::RestrictToRootDisplayPort(

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

@ -95,8 +95,8 @@ class ScrollFrameHelper : public nsIReflowCallback {
// wrapped in the async zoom container, if we're building one.
// It should not be called with an ASR setter on the stack, as the
// top-layer items handle setting up their own ASRs.
nsDisplayWrapList* MaybeCreateTopLayerItems(nsDisplayListBuilder* aBuilder,
bool* aIsOpaque);
void MaybeAddTopLayerItems(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists);
void AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists, bool aCreateLayer,