Open Bug 1343538 Opened 7 years ago Updated 2 years ago

Overpainting on Google docs

Categories

(Core :: Web Painting, enhancement)

enhancement

Tracking

()

Performance Impact low
Tracking Status
platform-rel --- +

People

(Reporter: ehsan.akhgari, Unassigned)

References

(Depends on 2 open bugs)

Details

(Keywords: perf, perf:responsiveness, Whiteboard: [platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs])

We seem to be overpainting in google docs quite a bit.  I'll add more useful info to the bug later...
It seems like one way to reproduce the issue is to place the mouse on the side area of the doc, and then slowly move it horizontally over to the content area of the doc.  We typically paint the entire content area of the doc.  A similar issue happens when overlaying the Outline view on the left side.  Same with any comment boxes on the right side.

Sometimes a horizontal bar between the UI area of the docs and their content section gets repainted but it's hard to say what that corresponds to (perhaps the ruler at the top but the painted area is taller than the ruler.)

Overall the situation is pretty terrible.  Turning on paint flashing on GDocs should be enough to find tons of issues.  kats saw some of the issues on his machine too.
This is probably an invalidation bug since when I was seeing it nothing appeared to be visibly changing on the screen but paintflashing was going crazy repainting a large area.
Component: Graphics → Layout: Web Painting
Whiteboard: [qf:p1]
Matt, any chance you could take a look at this, please?
Flags: needinfo?(matt.woodrow)
I can reproduce the issue with the Outline view consistently, and it looks like a layerization issue.

It looks like we have an opacity layer added around some content, and this is forced into an active layer since it has an animation/transition on it.

For some reason though, this is moving most of the page content into a new PaintedLayer on top of the opacity layer, and we have to repaint the old layer (to remove the popped content) as well as the new layer (to draw the popped content). The reverse happens again when the opacity is removed.

It's not obvious why this happening though, and there doesn't look like there's anything that both intersects the opacity, but is behind the rest of the page content.

When the opacity is removed our layer tree changes like this: https://pastebin.mozilla.org/8982137

The opacity ContainerLayer 0x130d2e000, along with 3 PaintedLayers on top of it all removed.

The display list difference between these two paints is: https://www.diffchecker.com/blr3kgnT

Most of the changes are just differences in visible regions (being either 0, or real), I think due to us not having called RecomputeVisibility on one of the lists.

The first interesting difference is line 896, where the opacity item goes away.

The first item after the opacity still made it in to the background PaintedLayer (0x12a971c00), but the next painted item (Border, line 910) is popped into a new layer.

The border doesn't intersect the opacity layer, and has the same AGR, ASR and clip chain as the transform, so I can't see why we decided it needed a new layer instead of using 0x12a971c00.

From there, most of the rest of the changes are items going in to the popped layers instead of the background.

Any ideas why this might happen Markus?
Flags: needinfo?(matt.woodrow) → needinfo?(mstange)
platform-rel: --- → ?
Whiteboard: [qf:p1] → [qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Assignee: nobody → bugs
(In reply to Matt Woodrow (:mattwoodrow) from comment #4)
> Any ideas why this might happen Markus?

No, and I agree with you that it seems unexpected. We'll need to capture this in an rr recording and debug it properly.
Flags: needinfo?(mstange)
platform-rel: ? → +
(In reply to Matt Woodrow (:mattwoodrow) from comment #4)
> The border doesn't intersect the opacity layer, and has the same AGR, ASR
> and clip chain as the transform, so I can't see why we decided it needed a
> new layer instead of using 0x12a971c00.
> 
> From there, most of the rest of the changes are items going in to the popped
> layers instead of the background.

Adding a dependency on bug 1351811 so that we address this when we start retaining clips, clip chain, AGR and ASR information on the frame tree.
Depends on: 1351811
Flags: needinfo?(aschen)
Whiteboard: [qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:p2][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Jet, you're assigned to the bug, but I think that means you're looking for someone else to work on it.  What's the current status of this bug?  This came up again in the light of bug 1271544 and bug 1271935 where I suspect we're possibly being hurt by this bug.  Do you mind giving an update please?
Flags: needinfo?(bugs)
(In reply to :Ehsan Akhgari (needinfo please, extremely long backlog) from comment #7)
> Jet, you're assigned to the bug, but I think that means you're looking for
> someone else to work on it.  

Actually, QF:P1 bugs assigned to me mean that we'll address the issue in other work. In this case, the work for bug 1351811 should improve things here. 

Matt: can you fire this up in your local build and see if it still happens? If so, we'll have to plug this another way.
Flags: needinfo?(bugs) → needinfo?(matt.woodrow)
(In reply to Jet Villegas (:jet) from comment #8)
> (In reply to :Ehsan Akhgari (needinfo please, extremely long backlog) from
> comment #7)
> > Jet, you're assigned to the bug, but I think that means you're looking for
> > someone else to work on it.  
> 
> Actually, QF:P1 bugs assigned to me mean that we'll address the issue in
> other work. In this case, the work for bug 1351811 should improve things
> here. 
> 
> Matt: can you fire this up in your local build and see if it still happens?
> If so, we'll have to plug this another way.

It still does. Bug 1351811 helps us build display lists faster, but this is an issue where we're layerizing differently and needing a large repaint to update to that.
Flags: needinfo?(matt.woodrow)
Bug 1370575 sounds like another instance of this problem. I'll find a lucky winner with a rr setup to carve into this one as per comment 5.
See Also: → 1370575
Assignee: bugs → mstange
Flags: needinfo?(aschen)
I'm expecting the patch in bug 1217748 to help with this. I'm currently looking into the test failures it caused.
Keywords: perf
Whiteboard: [qf:p2][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Whiteboard: [qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:i60][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Whiteboard: [qf:i60][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:f60][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Whiteboard: [qf:f60][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:f61][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Whiteboard: [qf:f61][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:f64][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Now that bug 1217748 is closed, we should re-test this.
Whiteboard: [qf:f64][qf:p1][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:p1:f64][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
(In reply to Mike Conley (:mconley) (:⚙️) (Catching up on needinfos / reviews) from comment #12)
> Now that bug 1217748 is closed, we should re-test this.

Looks like the patch got backed out. Markus, will you have time to get this relanded in the 64 timeframe?
Flags: needinfo?(mstange)
Assignee: mstange → nobody
Whiteboard: [qf:p1:f64][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [qf:p3:responsiveness][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]

Unfortunately not. This bug isn't that important anyway; we're doing a bunch of unnecessary work but it doesn't slow down the interaction very much, as far as I'm aware, and with WebRender on the horizon it's less valuable to spend effort on invalidation bugs.

Flags: needinfo?(mstange)
Performance Impact: --- → P3
Whiteboard: [qf:p3:responsiveness][platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs] → [platform-rel-Google][platform-rel-GoogleSuite][platform-rel-GoogleDocs]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.