Commit c4a8929e authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Remove invalidation code when creating new PaintLayers.

This code was originally added in [1]. The web_test added in that
CL still passes, as does a subsequent related unittest added in another
CL (PaintLayerPainterTest, PaintPhasesUpdateOnLayerAddition).

I'm not sure what caused these to keep passing with the code removed -
there is a reference in [1] to re-use of DisplayItemClient pointers,
perhaps that was improved since then?

[1] https://codereview.chromium.org/1403963002

The bug reported in issue 541544 also does not reproduce with this CL
applied.

Bug: 1104794

Change-Id: I91addcea57c217dd1f971fcc4dbae0cd518c7011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2307610
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790106}
parent df233a99
......@@ -148,26 +148,6 @@ void ObjectPaintInvalidator::
});
}
void ObjectPaintInvalidator::
InvalidatePaintIncludingNonSelfPaintingLayerDescendants() {
SlowSetPaintingLayerNeedsRepaint();
// This method may be used to invalidate paint of objects changing paint
// invalidation container.
struct Helper {
static void Traverse(const LayoutObject& object) {
object.GetMutableForPainting().SetShouldDoFullPaintInvalidation(
PaintInvalidationReason::kCompositing);
for (LayoutObject* child = object.SlowFirstChild(); child;
child = child->NextSibling()) {
if (!child->HasLayer() ||
!ToLayoutBoxModelObject(child)->Layer()->IsSelfPaintingLayer())
Traverse(*child);
}
}
};
Helper::Traverse(object_);
}
#if DCHECK_IS_ON()
void ObjectPaintInvalidator::CheckPaintLayerNeedsRepaint() {
DCHECK(!object_.PaintingLayer() ||
......
......@@ -56,7 +56,6 @@ class CORE_EXPORT ObjectPaintInvalidator {
}
void InvalidatePaintIncludingNonCompositingDescendants();
void InvalidatePaintIncludingNonSelfPaintingLayerDescendants();
protected:
#if DCHECK_IS_ON()
......
......@@ -1392,25 +1392,7 @@ void PaintLayer::InsertOnlyThisLayerAfterStyleChange() {
curr = curr->NextSibling())
curr->MoveLayers(parent_, this);
// If the previous directly composited container is not a stacking context and
// this object is stacked content, creating this layer may cause this object
// and its descendants to change paint invalidation container.
bool did_set_paint_invalidation = false;
if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled() &&
!IsA<LayoutView>(GetLayoutObject()) && GetLayoutObject().IsRooted() &&
GetLayoutObject().IsStacked()) {
const LayoutBoxModelObject& previous_directly_compositable_container =
GetLayoutObject().Parent()->DirectlyCompositableContainer();
if (!previous_directly_compositable_container.IsStackingContext()) {
ObjectPaintInvalidator(GetLayoutObject())
.InvalidatePaintIncludingNonSelfPaintingLayerDescendants();
// Set needsRepaint along the original compositingContainer chain.
GetLayoutObject().Parent()->EnclosingLayer()->SetNeedsRepaint();
did_set_paint_invalidation = true;
}
}
if (!did_set_paint_invalidation && IsSelfPaintingLayer() && parent_) {
if (IsSelfPaintingLayer() && parent_) {
if (PaintLayer* enclosing_self_painting_layer =
parent_->EnclosingSelfPaintingLayer())
MergeNeedsPaintPhaseFlagsFrom(*enclosing_self_painting_layer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment