DescriptionAvoid using forced layout to trigger paint invalidation for SVG containers
Currently, SVG containers in the LayoutObject hierarchy force layout of
their children if the transform changes. The main reason for this is to
trigger paint invalidation of the subtree. In some cases - changes to the
scale factor - there are other reasons to trigger layout, like computing
a new scale factor for <text> or re-layout nodes with non-scaling stroke.
Compute a "scale-factor change" in addition to the "transform change"
already computed, then use this new signal to determine if layout should
be forced for the subtree. Trigger paint invalidation using the
LayoutObject flags instead.
The downside to this is that paint invalidation will walk into "hidden"
containers which rarely require repaint (since they are not technically
visible). This will hopefully be rectified in a follow-up CL.
For the testcase from 603850, this essentially eliminates the cost of
layout (from ~350ms to ~0ms on authors machine; layout cost is related
to text metrics recalculation), bumping frame rate significantly.
BUG=603956, 603850
Committed: https://crrev.com/44f1431b20c16d8f8da0ce8ff7bbf2adddcdd785
Cr-Commit-Position: refs/heads/master@{#400950}
Patch Set 1 #Patch Set 2 : Rebased and changed scale-change detection #Patch Set 3 : Rebase #Patch Set 4 : NeedsRebaseline -> NeedsManualRebaseline #Patch Set 5 : Rebase #
Total comments: 5
Patch Set 6 : Use enum instead of bitfield #
Total comments: 2
Patch Set 7 : Add comment #Patch Set 8 : TE updates #Messages
Total messages: 17 (6 generated)
|