Skip to content

Commit

Permalink
Remove willFlushRetainedLayers, which is superceded by DLBI. (bug 120…
Browse files Browse the repository at this point in the history
…5970 part 2, r=mattwoodrow)
  • Loading branch information
David Anderson committed Sep 19, 2015
1 parent f874dc5 commit 300922f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 50 deletions.
8 changes: 0 additions & 8 deletions layout/base/nsDisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,10 +1508,6 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
layerBuilder->SetLayerTreeCompressionMode();
}

if (aFlags & PAINT_FLUSH_LAYERS) {
FrameLayerBuilder::InvalidateAllLayers(layerManager);
}

if (doBeginTransaction) {
if (aCtx) {
layerManager->BeginTransactionWithTarget(aCtx->ThebesContext());
Expand Down Expand Up @@ -1712,10 +1708,6 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
}
}

if (aFlags & PAINT_FLUSH_LAYERS) {
FrameLayerBuilder::InvalidateAllLayers(layerManager);
}

layerManager->SetUserData(&gLayerManagerLayerBuilder, oldBuilder);
return layerManager.forget();
}
Expand Down
4 changes: 0 additions & 4 deletions layout/base/nsDisplayList.h
Original file line number Diff line number Diff line change
Expand Up @@ -1982,9 +1982,6 @@ class nsDisplayList {
* 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.
Expand All @@ -2001,7 +1998,6 @@ class nsDisplayList {
enum {
PAINT_DEFAULT = 0,
PAINT_USE_WIDGET_LAYERS = 0x01,
PAINT_FLUSH_LAYERS = 0x02,
PAINT_EXISTING_TRANSACTION = 0x04,
PAINT_NO_COMPOSITE = 0x08,
PAINT_COMPRESSED = 0x10
Expand Down
39 changes: 1 addition & 38 deletions layout/base/nsLayoutUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 300922f

Please sign in to comment.