Closed Bug 539165 Opened 10 years ago Closed 10 years ago

gradients with a single stop do not have their color multiplied by the alpha.

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
mozilla1.9.3a1
Tracking Status
status1.9.2 --- .2-fixed
status1.9.1 --- unaffected

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

(Keywords: verified1.9.2)

Attachments

(1 file, 3 obsolete files)

This cairo commit caused the problem: 2d790daa957471670f4ae0d3b22da89e4ee7111f. It was merged into mozilla-central in: 1effb72d30cf

The attached patch reverts the 'optimization' that removed the multiplication by alpha. I'll throw a reftest together for this when I get the chance.
Attachment #421194 - Flags: review?(roc)
Blocks: 530550
Attachment #421194 - Attachment is patch: true
Attachment #421194 - Attachment mime type: application/octet-stream → text/plain
This is a regression from 3.5 but I don't think it's that serious. It only breaks single stop gradients with alpha on win32 and it has been broken since March without anyone noticing.
Flags: wanted1.9.2?
Attachment #421194 - Flags: approval1.9.2.1?
Attached patch reftest (obsolete) — Splinter Review
How about this?
Assignee: nobody → jmuizelaar
Attachment #421198 - Flags: review?(roc)
OS: Mac OS X → Windows 7
Comment on attachment 421198 [details] [diff] [review]
reftest

super, thanks
Attachment #421198 - Flags: review?(roc) → review+
Multi-stop solid gradients are broken too. This patch includes fixes for both cases, but is basically the same as the last one. This one properly passes the reftest that I posted earlier.
Attachment #421194 - Attachment is obsolete: true
Attachment #421198 - Attachment is obsolete: true
Attachment #421279 - Flags: review?(roc)
Attachment #421194 - Flags: approval1.9.2.1?
reftest.list needs updating to current trunk where I changed when the opacity 01 reftest runs. I think OSX 10.4 support may be going away though.
http://hg.mozilla.org/mozilla-central/rev/4b725bb53baa
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Backed out die to reftest failures on OSX:

REFTEST TEST-UNEXPECTED-FAIL | file:///builds/slave/mozilla-central-macosx-opt-unittest-everythingelse/build/reftest/tests/layout/reftests/svg/opacity-and-gradient-02.svg |
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This happens because OS X doesn't draw the gradient as a solid color. I think it used to because I don't think a ran into this problem when I had the patch against an older version of trunk. roc, doing think any of our gradient changes would cause this behaviour change?
Nevermind, I had thought this passed on the try server. I looked back and it looks like it didn't...
Anyone have any suggestions for how to fix this test?
Does the test pass if the reference uses a single-stop opaque red gradient, and you apply opacity="0.5" to that?
The colors on the left hand side are out by 1 #7F7F00 vs #807F00. It it cairo that is calculating this or does cairo make OS X Core Graphics calls to do this.

Tweaking the colours or the opacity may help to sidestep if this is some kind of rounding error when the opacity is applied to the color values. You've gone for red (i.e. FF0000) divided by 2 to get #7F or #80. If you went for some RGB values where the r, g and b values are divisible by 2 you might fare better.
(In reply to comment #14)
> The colors on the left hand side are out by 1 #7F7F00 vs #807F00. It it cairo
> that is calculating this or does cairo make OS X Core Graphics calls to do
> this.

Mostly CoreGraphics.

> 
> Tweaking the colours or the opacity may help to sidestep if this is some kind
> of rounding error when the opacity is applied to the color values. You've gone
> for red (i.e. FF0000) divided by 2 to get #7F or #80. If you went for some RGB
> values where the r, g and b values are divisible by 2 you might fare better.

I tried this kind of thing without much success.

(In reply to comment #13)
> Does the test pass if the reference uses a single-stop opaque red gradient, and
> you apply opacity="0.5" to that?

I'll give this a try.
Attachment #422995 - Flags: approval1.9.2.1?
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Duplicate of this bug: 544449
Comment on attachment 422995 [details] [diff] [review]
The patch that landed on trunk

a1.9.2.2=beltzner
Attachment #422995 - Flags: approval1.9.2.2? → approval1.9.2.2+
Flags: wanted1.9.2?
Reftests have been passed since the check-in happened on trunk and 1.9.2. Given the greenish waterfall on tinderbox I'll mark it verified fixed.

Jeff, can you please also set in-testsuite+ for checked-in tests? Thanks.
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Flags: in-litmus-
Keywords: verified1.9.2
OS: Windows 7 → All
Hardware: x86 → All
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.