Closed Bug 1012797 Opened 10 years ago Closed 10 years ago

Speed up rendering of linear gradients when only painting the uniform color beyond the gradient edge

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file)

Attached patch v1Splinter Review
Bugzilla uses a linear-gradient(#D7D3C8, #F6F4EC 400px) as its background. This gradient is only an actual gradient in the top 400px of the page; below that it's just a uniform color. If our paint area is completely in the uniform color area we can just use a simple color fill when painting.

This also works around bug 1010188, which is a pixman (and gdi?) problem on very long bugzilla pages, i.e. longer than 32768px: When scrolled down far enough, the ctx->Translate(tileRect.TopLeft()) call translates by a value larger than 2^15, and pixman's internal matrix storage apparently uses 16.16 fixed point, so we fail to render the gradient. This patch is a workaround for that particular bugzilla use case.

The math in this patch is your work, roc. (from bug 508730)
Attachment #8424990 - Flags: review?(roc)
Comment on attachment 8424990 [details] [diff] [review]
v1

Review of attachment 8424990 [details] [diff] [review]:
-----------------------------------------------------------------

Nice! That Bugzilla bug has been bugging me :-)
Attachment #8424990 - Flags: review?(roc) → review+
Might want to add a reftest for the Bugzilla rendering bug too.
https://hg.mozilla.org/integration/mozilla-inbound/rev/5574008af2b6

I'll add tests for giant gradients when I fix the general case in bug 1011166.
https://hg.mozilla.org/mozilla-central/rev/5574008af2b6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Blocks: 1010188
Blocks: 1014764
No longer blocks: 1014764
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: