diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 6b1517bcced..73ae1033b74 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1508,10 +1508,6 @@ already_AddRefed nsDisplayList::PaintRoot(nsDisplayListBuilder* aB layerBuilder->SetLayerTreeCompressionMode(); } - if (aFlags & PAINT_FLUSH_LAYERS) { - FrameLayerBuilder::InvalidateAllLayers(layerManager); - } - if (doBeginTransaction) { if (aCtx) { layerManager->BeginTransactionWithTarget(aCtx->ThebesContext()); @@ -1712,10 +1708,6 @@ already_AddRefed nsDisplayList::PaintRoot(nsDisplayListBuilder* aB } } - if (aFlags & PAINT_FLUSH_LAYERS) { - FrameLayerBuilder::InvalidateAllLayers(layerManager); - } - layerManager->SetUserData(&gLayerManagerLayerBuilder, oldBuilder); return layerManager.forget(); } diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 8eb2459bddb..a844fa44f26 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1982,9 +1982,6 @@ public: * otherwise we will use a temporary BasicLayerManager and ctx must * not be null. * - * If PAINT_FLUSH_LAYERS is set, we'll force a completely new layer - * tree to be created for this paint *and* the next paint. - * * If PAINT_EXISTING_TRANSACTION is set, the reference frame's widget's * layer manager has already had BeginTransaction() called on it and * we should not call it again. @@ -2001,7 +1998,6 @@ public: enum { PAINT_DEFAULT = 0, PAINT_USE_WIDGET_LAYERS = 0x01, - PAINT_FLUSH_LAYERS = 0x02, PAINT_EXISTING_TRANSACTION = 0x04, PAINT_NO_COMPOSITE = 0x08, PAINT_COMPRESSED = 0x10 diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 7df94ff6502..1a5c9bd0326 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -3136,17 +3136,11 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram visibleRegion = aDirtyRegion; } - // If we're going to display something different from what we'd normally - // paint in a window then we will flush out any retained layer trees before - // *and after* we draw. - bool willFlushRetainedLayers = (aFlags & PAINT_HIDE_CARET) != 0; - nsDisplayList list; // If the root has embedded plugins, flag the builder so we know we'll need // to update plugin geometry after painting. if ((aFlags & PAINT_WIDGET_LAYERS) && - !willFlushRetainedLayers && !(aFlags & PAINT_DOCUMENT_RELATIVE) && rootPresContext->NeedToComputePluginGeometryUpdates()) { builder.SetWillComputePluginGeometry(true); @@ -3262,33 +3256,12 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram buildingDisplayList(&builder, aFrame, canvasArea, false); presShell->AddCanvasBackgroundColorItem( builder, list, aFrame, canvasArea, aBackstop); - - // If the passed in backstop color makes us draw something different from - // normal, we need to flush layers. - if ((aFlags & PAINT_WIDGET_LAYERS) && !willFlushRetainedLayers) { - nsView* view = aFrame->GetView(); - if (view) { - nscolor backstop = presShell->ComputeBackstopColor(view); - // The PresShell's canvas background color doesn't get updated until - // EnterPresShell, so this check has to be done after that. - nscolor canvasColor = presShell->GetCanvasBackground(); - if (NS_ComposeColors(aBackstop, canvasColor) != - NS_ComposeColors(backstop, canvasColor)) { - willFlushRetainedLayers = true; - } - } - } } builder.LeavePresShell(aFrame); Telemetry::AccumulateTimeDelta(Telemetry::PAINT_BUILD_DISPLAYLIST_TIME, startBuildDisplayList); - if (builder.GetHadToIgnorePaintSuppression()) { - willFlushRetainedLayers = true; - } - - bool profilerNeedsDisplayList = profiler_feature_active("displaylistdump"); bool consoleNeedsDisplayList = gfxUtils::DumpDisplayList() || gfxUtils::sDumpPainting; #ifdef MOZ_DUMP_PAINTING @@ -3332,16 +3305,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram uint32_t flags = nsDisplayList::PAINT_DEFAULT; if (aFlags & PAINT_WIDGET_LAYERS) { flags |= nsDisplayList::PAINT_USE_WIDGET_LAYERS; - if (willFlushRetainedLayers) { - // The caller wanted to paint from retained layers, but set up - // the paint in such a way that we can't use them. We're going - // to display something different from what we'd normally paint - // in a window, so make sure we flush out any retained layer - // trees before *and after* we draw. Callers should be fixed to - // not do this. - NS_WARNING("Flushing retained layers!"); - flags |= nsDisplayList::PAINT_FLUSH_LAYERS; - } else if (!(aFlags & PAINT_DOCUMENT_RELATIVE)) { + if (!(aFlags & PAINT_DOCUMENT_RELATIVE)) { nsIWidget *widget = aFrame->GetNearestWidget(); if (widget) { // If we're finished building display list items for painting of the outermost @@ -3416,7 +3380,6 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram // glass boundaries on Windows. Also set up the window dragging region // and plugin clip regions and bounds. if ((aFlags & PAINT_WIDGET_LAYERS) && - !willFlushRetainedLayers && !(aFlags & PAINT_DOCUMENT_RELATIVE)) { nsIWidget *widget = aFrame->GetNearestWidget(); if (widget) {