Closed Bug 966996 Opened 10 years ago Closed 10 years ago

Repeating linear gradients applied to giant boxes render slowly and incorrectly on Mac

Categories

(Core :: Graphics, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(3 files)

Attached file testcase
The testcase has a scrollable area that contains a 600px * 80000px box that has a repeating linear gradient as its background. Scrolling the box is very slow and the gradient stops are in the wrong locations.
This fixes the performance when we're not scrolled down much.
Attachment #8369429 - Flags: review?(jmuizelaar)
We calculate t_min and t_max in such a way that they always include zero. That's unnecessary because our displayed part of the gradient may be far away from zero, so initialize t_min and t_max to +- Infinity so that they always get replaced by the UpdateLinearParametersToIncludePoint call for the extent rect's top left corner.

This fixes the case when the testcase is scrolled down a lot.
Attachment #8369438 - Flags: review?(jmuizelaar)
Attachment #8369429 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8369438 [details] [diff] [review]
part 2: Don't include t=0 when not necessary

>+  MOZ_ASSERT(!isinf(t_min) && !isinf(t_max),
>+             "The first call to UpdateLinearParametersToIncludePoint should have made t_min and t_max non-infinite.");

I realize now that "finite" is the short way of saying "non-infinite". Will fix before checkin.
Attachment #8369438 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/28b77fb96e62
https://hg.mozilla.org/mozilla-central/rev/7d6e5cd7fe20
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
No longer depends on: 928168
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: