Closed
Bug 800859
Opened 12 years ago
Closed 12 years ago
Make MozAfterPaint fire after composition
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: dao, Assigned: roc)
References
Details
(Whiteboard: [Snappy:P1])
Attachments
(4 files, 2 obsolete files)
12.79 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
6.89 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
14.95 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
1.21 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
From bug 715402 comment 77: > > > > Currently MozAfterPaint fires when we've finished drawing the window > > > > contents to the layer tree, but before we composite that to the window. But > > > > let's fix that. > > > > > > Actually, let's not, since MozAfterPaint was designed to tell us about which > > > areas of the window have been redrawn, so it needs to fire after they've > > > been drawn and before new dirty areas are accumulated. > > > > That's not really what most MozAfterPaint consumers I've seen want. What > > also seems worrisome to me here is that talos makes extensive use of > > MozAfterPaint, apparently missing an important last step. > > OK. > > > > What you really want here is something to tell you when the window has been > > > composited, and we have no event for that. Plus we're driving towards having > > > that happen off the main thread, which makes this tricky. > > > > When composition happens off the main thread, a MozAfterPaint listener won't > > block it and we won't care about it as far as this bug is concerned, right? > > You probably still want to delay your delayedStartup work until after the > compositor thread has composited the window, since the two threads can still > contend for resources. > > I *suppose* we could make MozAfterPaint fire after the composite, carrying a > list of the rectangles we repainted in the paint phase before the composite, > even if new stuff has been invalidated between the paint and the composite. > Maybe we should do that.
Reporter | ||
Comment 2•12 years ago
|
||
(In reply to Taras Glek (:taras) from comment #1) > p1 since it blocks a p1. Also the fact that this affects talos might be enough to make this a p1...
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → roc
Assignee | ||
Comment 3•12 years ago
|
||
Cautious try push first: https://tbpl.mozilla.org/?tree=Try&rev=0130b70b25c0
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #673092 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #673093 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #673094 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 7•12 years ago
|
||
These patches change invariants slightly ... right after a MozAfterPaint fires, DOMWindowUtils.isMozAfterPaintPending can still return true, since we could have a pending paint event that hasn't been composited yet. I think that's OK.
Assignee | ||
Comment 8•12 years ago
|
||
This seems to have exposed a number of tests that expect subdocuments that aren't toplevel content documents to receive MozAfterPaint events.
Assignee | ||
Comment 9•12 years ago
|
||
Also, dom/browser-element/BrowserElementChild.js seems to require MozAfterPaint to fire on arbitrary subdocuments. The strange thing is that I thought we disabled that in DLBI already, restricting MozAfterPaint to toplevel documents and toplevel content documents only.
Assignee | ||
Comment 10•12 years ago
|
||
Try to make MozAfterPaint work in all kinds of subdocuments: https://tbpl.mozilla.org/?tree=Try&rev=8d660b0a8b2b
Assignee | ||
Comment 11•12 years ago
|
||
That was green! Trying all platforms: https://tbpl.mozilla.org/?tree=Try&rev=53f6e9745676
Assignee | ||
Comment 12•12 years ago
|
||
Tightens up handling of mAllInvalidated to avoid bugs/assertions.
Attachment #673498 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 13•12 years ago
|
||
This turns out to be super easy...
Attachment #673499 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 14•12 years ago
|
||
Try results look good.
Updated•12 years ago
|
Attachment #673092 -
Flags: review?(matt.woodrow) → review+
Updated•12 years ago
|
Attachment #673093 -
Flags: review?(matt.woodrow) → review+
Comment 15•12 years ago
|
||
Comment on attachment 673498 [details] [diff] [review] Part 3 v2 Review of attachment 673498 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsPresContext.cpp @@ +2271,5 @@ > } > > + if (!mFireAfterPaintEvents) { > + return; > + } This change here is why we need part 4. Previously we were only checking for mFireAfterPaintEvent on the root pres context, and if true we would fire MozAfterPaint for all subdocuments (even though they wouldn't have any rects stored).
Attachment #673498 -
Flags: review?(matt.woodrow) → review+
Comment 16•12 years ago
|
||
Comment on attachment 673499 [details] [diff] [review] Part 4: Enable MozAfterPaint for all subdocuments Review of attachment 673499 [details] [diff] [review]: ----------------------------------------------------------------- Patch looks good, but are we sure that we want to do this? The extra compositing cost on BasicLayers might be an issue, not really convinced it's a problem though. When we discussed this originally, we decided that it would be better to just send empty MozAfterPaint events to all subdocuments.
Attachment #673499 -
Flags: review?(matt.woodrow) → review+
Assignee | ||
Comment 17•12 years ago
|
||
(In reply to Matt Woodrow (:mattwoodrow) from comment #15) > This change here is why we need part 4. Previously we were only checking for > mFireAfterPaintEvent on the root pres context, and if true we would fire > MozAfterPaint for all subdocuments (even though they wouldn't have any rects > stored). True. However, part 4 also ensures we compute the correct invalidation rects for all subdocuments, which we weren't doing before.
Assignee | ||
Comment 18•12 years ago
|
||
(In reply to Matt Woodrow (:mattwoodrow) from comment #16) > Patch looks good, but are we sure that we want to do this? The extra > compositing cost on BasicLayers might be an issue, not really convinced it's > a problem though. > When we discussed this originally, we decided that it would be better to > just send empty MozAfterPaint events to all subdocuments. Now that you mention it, we don't want to do this. I had been thinking it would only force subdocuments to have layers when they have MozAfterPaint listeners registered on them, but of course if there's a MozAfterPaint listener registered on a window then nsPresContext::MayHavePaintEventListener will return true for all its descendants. So a single MozAfterPaint listener on a toplevel content document would layerize all its IFRAMEs, which could be bad.
Assignee | ||
Comment 19•12 years ago
|
||
Attachment #673094 -
Attachment is obsolete: true
Attachment #673499 -
Attachment is obsolete: true
Attachment #673094 -
Flags: review?(matt.woodrow)
Attachment #674048 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 20•12 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=744ea1f34d52
Updated•12 years ago
|
Attachment #674048 -
Flags: review?(matt.woodrow) → review+
Assignee | ||
Comment 21•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6e108817d0c5 https://hg.mozilla.org/integration/mozilla-inbound/rev/1bf5c18ae382 https://hg.mozilla.org/integration/mozilla-inbound/rev/74f3a93b9283 https://hg.mozilla.org/integration/mozilla-inbound/rev/bf04510e09ee
Comment 22•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6e108817d0c5 https://hg.mozilla.org/mozilla-central/rev/1bf5c18ae382 https://hg.mozilla.org/mozilla-central/rev/74f3a93b9283 https://hg.mozilla.org/mozilla-central/rev/bf04510e09ee
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•