Closed Bug 1177149 Opened 4 years ago Closed 4 years ago

Look at why this text effect is slow

Categories

(Core :: General, defect)

Unspecified
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: potch, Assigned: mattwoodrow)

Details

(Keywords: DevAdvocacy)

Attachments

(1 file, 1 obsolete file)

This demo runs > 40fps in Chrome, < 1fps in Firefox:

http://codepen.io/lbebber/pen/QbMZqO
Keywords: DevAdvocacy
We repaint the whole layer contents when transform-origin is updated, and painting the layer contents is expensive because it's using opacity. We should stop repainting the layer.

Commenting out these lines of code makes it run quite smoothly: https://dxr.mozilla.org/mozilla-central/source/layout/style/nsStyleStruct.cpp#2837-2841
Don't we want nsChangeHint_UpdateTransformLayer|nsChangeHint_UpdatePostTransformOverflow?
Sounds good to me. You know the implications of that better than I do. Want to fix?
Assignee: nobody → matt.woodrow
Attachment #8625969 - Flags: review?(dbaron)
This seems fine for transform-origin, but I'm worried about perspective-origin.  We don't use these hints for 'perspective' itself... it's not clear to me that they'll do the right thing for perspective-origin.  (For example, would they even be sent to the right frame?)
Flags: needinfo?(matt.woodrow)
That's a good point, let's not bother with perspective-origin for now and we can look at solving that properly later.
Attachment #8625969 - Attachment is obsolete: true
Attachment #8625969 - Flags: review?(dbaron)
Flags: needinfo?(matt.woodrow)
Attachment #8626212 - Flags: review?(dbaron)
Attachment #8626212 - Flags: review?(dbaron) → review+
https://hg.mozilla.org/mozilla-central/rev/6b6c58581aff
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.