Closed
Bug 724189
Opened 13 years ago
Closed 12 years ago
Tracking: Make page transitions in the Gaia SMS app fast
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: cjones, Assigned: roc)
References
()
Details
Attachments
(7 files, 2 obsolete files)
(deleted),
patch
|
roc
:
review+
cjones
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
cjones
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
roc
:
review+
cjones
:
checkin+
|
Details | Diff | Splinter Review |
If you open the sms app and then click "New Message" e.g., there will be a CSS transition started between the main screen and the new message screen. The fps of this on device (Galaxy S II) is very low, 5-10 fps. Paint flashing shows that we're repainting the screens like crazy. The framerate seems to inversely depend on the size of the page; for the "Erasmus Flynn" conversation view, which has many messages, the transition framerate is lower than for "Aladdin Ellison", which has fewer. I'm not sure why that is.
The sms app currently puts a transition on ".left", which will definitely force reflow in general. However, switching the transition to an animated translation transform doesn't help, even though it should.
The -->translation switch and bug 722923 might be enough to fix this.
Reporter | ||
Comment 1•13 years ago
|
||
> The -->translation switch and bug 722923 might be enough to fix this.
Nope, still slow.
Reporter | ||
Comment 2•13 years ago
|
||
What's going on here is that the frame that we're "sliding in" is width:100% height:100% so should hit our prerender optimization. It doesn't though; paint flashing shows we repaint it on every sample of the transition.
The frame has a box-shadow of radius 20px. If I remove that and replace it with a border, then we indeed hit the prerender optimization and don't invalidate while sampling the transition.
I'm not sure whether the shadow is making the frame look larger than the window size and so throws out the optimization there, or whether the shadow is causing some other issue. Will poke a bit more.
Reporter | ||
Comment 3•13 years ago
|
||
(NB: I'm testing with the fix for bug 722923 applied.)
Reporter | ||
Comment 4•13 years ago
|
||
It looks like the nsDisplayTransform is counting the box shadow. So, I have a proposed fix!
Reporter | ||
Comment 5•13 years ago
|
||
This is part 1, because even with this fix something is causing the transformed frame to be invalidated.
Reporter | ||
Comment 6•13 years ago
|
||
(And yes, this fuzz factor is a slippery slope, and no, you don't want to know how I chose 1/8 ;).
Reporter | ||
Comment 7•13 years ago
|
||
The symptom here is the same as in bug 722923
void
nsIFrame::InvalidateTransformLayer()
{
bool hasLayer =
is returning false where hit, even though clearly the frame under transition is getting its own layer. Double checking that I have the patches applied correctly ...
Reporter | ||
Comment 8•13 years ago
|
||
Attachment #594540 -
Attachment is obsolete: true
Reporter | ||
Comment 9•13 years ago
|
||
So we're hitting
bool
nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsSize aNewSize)
{
//...
if (hasOutlineOrEffects) {
roc, anything we can do here?
Reporter | ||
Comment 10•13 years ago
|
||
Hmm, but in this case, I'm not sure that the "visual" overflow technically changes.
Assignee | ||
Comment 11•13 years ago
|
||
Assignee: nobody → roc
Attachment #594632 -
Flags: review?(matspal)
Reporter | ||
Comment 12•13 years ago
|
||
Comment on attachment 594550 [details] [diff] [review]
Part 1: Add a little fuzz factor to the max pre-render size for transformed frames, in case the frame has borders or shadows
Fix works great, thanks roc! Any happy Waitangi Day.
We also need this patch for this particular test case. It doesn't make me incredibly happy, but I think a fuzz region for borders etc. is reasonable. I have no idea what the heuristics should be, but like we did with the previous patch, we can tune this more in the future.
Attachment #594550 -
Flags: review?(roc)
Assignee | ||
Updated•13 years ago
|
Attachment #594550 -
Flags: review?(roc) → review+
Assignee | ||
Comment 13•13 years ago
|
||
Attachment #594634 -
Flags: review?(matspal)
Comment 14•13 years ago
|
||
Hmm, does this problem only occur on trunk / aurora? We have a known bug with
dynamic transform style changes that was intentionally introduced by bug 722325
to fix some other (more severe) bug. It will be fixed correctly in bug 724432.
Comment 15•13 years ago
|
||
Here's a testcase to illustrate the existing bug.
Try-server builds with bug 724432 fixed if you want to test it:
https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/mpalmgren@mozilla.com-fa1a77db5788/
Reporter | ||
Comment 16•13 years ago
|
||
I've only been testing with trunk. I'll try to check the try build later tonight.
In general, getting these bugs fixed is extremely high priority for us. On the test cases we've been analyzing, the performance on desktop FF goes from ~60fps *with* excessive invalidation to ~60fps with the bug fixed.
But on phone hardware, performance goes from ~10fps to 60fps with the fixes. That's the difference between laughably bad and competitive.
Comment 17•13 years ago
|
||
We urgently need this bug fixed for b2g. Can we mark the dependency on 724432 and we should get reviews as quickly as we can. We have MWC coming up and performance without this patch is miserable. Thanks!
Assignee | ||
Comment 18•13 years ago
|
||
(In reply to Mats Palmgren [:mats] from comment #14)
> Hmm, does this problem only occur on trunk / aurora?
No, I don't think so.
Assignee | ||
Comment 19•13 years ago
|
||
I mean, I think this bug has been around as long as we've been using UpdateTransformLayer hints.
Reporter | ||
Comment 20•13 years ago
|
||
(In reply to Mats Palmgren [:mats] from comment #15)
> Created attachment 594806 [details]
> Another testcase with dynamic transform changes
>
> Here's a testcase to illustrate the existing bug.
>
> Try-server builds with bug 724432 fixed if you want to test it:
> https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/mpalmgren@mozilla.
> com-fa1a77db5788/
Doesn't fix the bug here.
Reporter | ||
Comment 21•13 years ago
|
||
Mats, any ETA on review here?
Comment 22•13 years ago
|
||
Updated•13 years ago
|
Attachment #594634 -
Flags: review?(matspal) → review+
Comment 23•13 years ago
|
||
Comment on attachment 594632 [details] [diff] [review]
fix
Did you really intend to not invalidate anything at all even though
the post-transform visual overflow rect did change?
That doesn't look right to me. The only reason the content
is painted in its new position is the hideous hack in
InvalidateInternalAfterResize that UnionRect the damage rect
with its transformed self because "we don't know what coordinate
space this rectangle is in". *shrug*
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsFrame.cpp#4560
To illustrate my point, this patch applies on top of yours.
Load "Testcase #3" with paint flashing enabled. It shows that we
invalidate the old pre-transform rect (in DoApplyRenderingChangeToTree),
and the new post-transform rect. I think we should invalidate the
post-transform rect in both cases, at least for UpdateOverflow.
So that's two separate bugs that we should fix.
Is the second hunk in my patch what you really meant?
If so, r+ with that. I don't want a fix that rely on the UnionRect
bug though.
Attachment #594632 -
Flags: review?(matspal) → review-
Comment 24•13 years ago
|
||
Ignore the browser-thumbnails.js change, it's just to disable drawWindow()
calls for thumbnails which gets in the way of debugging.
Assignee | ||
Comment 25•13 years ago
|
||
Comment on attachment 596392 [details] [diff] [review]
debug patch
Review of attachment 596392 [details] [diff] [review]:
-----------------------------------------------------------------
You're absolutely right. This patch is correct (with the fix below). r+ with that.
Fortunately, bug 539356 will make all this mess go away.
::: layout/generic/nsFrame.cpp
@@ +6783,5 @@
> // changed (in particular, if it grows), we have to repaint the
> // new area here.
> Invalidate(aOverflowAreas.VisualOverflow());
> + }
> + } else if (anyOverflowChanged && hasTransform) {
this should not be "else if". It should just be "if" since we might need to invalidate along both paths.
Comment 26•13 years ago
|
||
Attachment #596392 -
Attachment is obsolete: true
Attachment #596703 -
Flags: review?(roc)
Comment 27•13 years ago
|
||
Comment on attachment 594632 [details] [diff] [review]
fix
r+ with the InvalidateLayer patch
Attachment #594632 -
Flags: review- → review+
Assignee | ||
Updated•13 years ago
|
Attachment #596703 -
Flags: review?(roc) → review+
Assignee | ||
Comment 28•13 years ago
|
||
Can you land this lot? :-)
Reporter | ||
Comment 29•13 years ago
|
||
Yes, but what's the ordering of your patches? Mine shouldn't depend on yours, can go before or after.
Assignee | ||
Comment 30•13 years ago
|
||
The only dependency is that 'InvalidateLayer' must apply on top of 'fix'.
Reporter | ||
Comment 31•13 years ago
|
||
roc, mats can I get some commit messages for your patches?
Comment 32•13 years ago
|
||
Mine is just a minor correction to roc's patch, so you can just fold it into his.
Reporter | ||
Comment 33•13 years ago
|
||
Thanks, will do.
Assignee | ||
Comment 34•13 years ago
|
||
"Bug 724189. Don't invalidate entire frame when the frame has shadows or effects and the post-transform overflow area changes. r=mats"
Reporter | ||
Comment 35•13 years ago
|
||
The test here apparently depends on the test from bug 722923. Omitting for this landing.
Reporter | ||
Comment 36•13 years ago
|
||
Reporter | ||
Updated•13 years ago
|
Attachment #594550 -
Flags: checkin+
Reporter | ||
Updated•13 years ago
|
Attachment #594632 -
Flags: checkin+
Reporter | ||
Updated•13 years ago
|
Attachment #596703 -
Flags: checkin+
Reporter | ||
Comment 37•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/43b3ef9500fe
https://hg.mozilla.org/integration/mozilla-inbound/rev/d4f7322ed113
Leaving open to land test.
Whiteboard: [inbound]
Comment 38•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/43b3ef9500fe
https://hg.mozilla.org/mozilla-central/rev/d4f7322ed113
Whiteboard: [inbound]
Updated•12 years ago
|
Blocks: b2g-product-phone
Updated•12 years ago
|
No longer blocks: b2g-demo-phone
Reporter | ||
Comment 39•12 years ago
|
||
Transitions there are fast.
Leaving the landing of the test to bug 722923.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•