From da0a3666b92697ee69642d127f08f13ff8dedbe3 Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Thu, 8 Oct 2020 04:12:57 +0300 Subject: [PATCH] Backed out 4 changesets (bug 1664804) for failures on browser_inspector_highlighter-geometry_06.js. CLOSED TREE Backed out changeset a54e27ab0e56 (bug 1664804) Backed out changeset 5e665bbcad8d (bug 1664804) Backed out changeset f9c62853d8ba (bug 1664804) Backed out changeset 17fef6ea08fe (bug 1664804) --- gfx/layers/ShareableCanvasRenderer.cpp | 3 -- .../opengl/MacIOSurfaceTextureHostOGL.cpp | 4 +- layout/generic/ViewportFrame.cpp | 44 +------------------ layout/generic/ViewportFrame.h | 3 +- layout/generic/nsGfxScrollFrame.cpp | 29 ++++-------- layout/generic/nsGfxScrollFrame.h | 4 +- 6 files changed, 13 insertions(+), 74 deletions(-) diff --git a/gfx/layers/ShareableCanvasRenderer.cpp b/gfx/layers/ShareableCanvasRenderer.cpp index a8f2c92e04c2..460f0688ee50 100644 --- a/gfx/layers/ShareableCanvasRenderer.cpp +++ b/gfx/layers/ShareableCanvasRenderer.cpp @@ -126,9 +126,6 @@ void ShareableCanvasRenderer::UpdateCompositableClient() { if (!YIsDown()) { flags |= TextureFlags::ORIGIN_BOTTOM_LEFT; } - if (IsOpaque()) { - flags |= TextureFlags::IS_OPAQUE; - } // - diff --git a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp index b00be853412a..f88712bb32c7 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp +++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp @@ -233,13 +233,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}, aPreferCompositorSurface, - /* aSupportsExternalCompositing */ false); + /* aSupportsExternalCompositing */ true); break; } case gfx::SurfaceFormat::YUV422: { diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp index d521b9a710c5..d3d4ea59e70f 100644 --- a/layout/generic/ViewportFrame.cpp +++ b/layout/generic/ViewportFrame.cpp @@ -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(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(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 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(backdropPh)->GetOutOfFlowFrame(); MOZ_ASSERT(backdropFrame); BuildDisplayListForTopLayerFrame(aBuilder, backdropFrame, aList); - - if (aIsOpaque) { - *aIsOpaque = BackdropListIsOpaque(this, aBuilder, aList); - } } BuildDisplayListForTopLayerFrame(aBuilder, frame, aList); } diff --git a/layout/generic/ViewportFrame.h b/layout/generic/ViewportFrame.h index ee68bd35cff3..2ab72b9cd4db 100644 --- a/layout/generic/ViewportFrame.h +++ b/layout/generic/ViewportFrame.h @@ -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; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index e8d209132b9f..cc4a8a570b2e 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3624,13 +3624,6 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsIScrollableFrame* sf = do_QueryFrame(mOuter); MOZ_ASSERT(sf); - // 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; - nsDisplayWrapList* topLayerWrapList = - MaybeCreateTopLayerItems(aBuilder, &topLayerIsOpaque); - if (ignoringThisScrollFrame) { // Root scrollframes have FrameMetrics and clipping on their container // layers, so don't apply clipping again. @@ -3647,7 +3640,7 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, false); } - if (!topLayerIsOpaque) { + { nsDisplayListBuilder::AutoBuildingDisplayList building( aBuilder, mOuter, visibleRect, dirtyRect); @@ -3657,9 +3650,7 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, aLists); } - if (topLayerWrapList) { - aLists.PositionedDescendants()->AppendToTop(topLayerWrapList); - } + MaybeAddTopLayerItems(aBuilder, aLists); if (addScrollBars) { // Add overlay scrollbars. @@ -3848,7 +3839,7 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, } } - if (!topLayerIsOpaque) { + { // Clip our contents to the unsnapped scrolled rect. This makes sure // that we don't have display items over the subpixel seam at the edge // of the scrolled area. @@ -3963,9 +3954,7 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, } } - if (topLayerWrapList) { - set.PositionedDescendants()->AppendToTop(topLayerWrapList); - } + MaybeAddTopLayerItems(aBuilder, set); if (willBuildAsyncZoomContainer) { MOZ_ASSERT(mClipAllDescendants); @@ -4068,13 +4057,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); @@ -4088,12 +4076,11 @@ nsDisplayWrapList* ScrollFrameHelper::MaybeCreateTopLayerItems( if (wrapList) { wrapList->SetOverrideZIndex( std::numeric_limitsZIndex())>::max()); - return wrapList; + aLists.PositionedDescendants()->AppendToTop(wrapList); } } } } - return nullptr; } nsRect ScrollFrameHelper::RestrictToRootDisplayPort( diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index efc6ff8148a9..31ded3fc78ec 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -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,