Fix performance regression related to overflow recalc

In r731227 we started to mark the container chain
in one extra situation compared with the previous code.
That introduced performance regressions in a few tests.
That situation was when SelfPaintingLayerNeedsVisualOverflowRecalc()
was false, in that case we also called

This patch comes back to the previous code when we only call
if SelfNeedsLayoutOverflowRecalc() is false.

This can be confusing when we call SetNeedsOverflowRecalc()
only for visual overflow, as we don't mark the ancestors
if SelfNeedsLayoutOverflowRecalc(). However this should
be safe anyway as MarkSelfPaintingLayerForVisualOverflowRecalc()
would have been called previously.

Bug: 1042855
Change-Id: Ifc7c0208ffdcef06a740d8a5091ba3f3b7466623
Reviewed-by: Philip Rogers <>
Commit-Queue: Philip Rogers <>
Cr-Commit-Position: refs/heads/master@{#735235}
4 files changed