RESOLVED FIXED Bug 41580
[chromium] Fix radial gradients
https://bugs.webkit.org/show_bug.cgi?id=41580
Summary [chromium] Fix radial gradients
Nico Weber
Reported 2010-07-04 11:04:32 PDT
Attachments
patch (4.50 KB, patch)
2010-07-04 11:11 PDT, Nico Weber
dglazkov: review-
thakis: commit-queue-
patch (4.33 KB, patch)
2010-07-05 21:21 PDT, Nico Weber
no flags
Pixel result, showing truncation (74.46 KB, image/png)
2010-07-08 16:00 PDT, Simon Fraser (smfr)
no flags
better test (1.90 KB, patch)
2010-07-08 16:17 PDT, Nico Weber
no flags
Patch (168.20 KB, patch)
2010-07-08 16:46 PDT, Nico Weber
no flags
Nico Weber
Comment 1 2010-07-04 11:11:29 PDT
Created attachment 60473 [details] patch In theory, we could also check if r0 > 0 and r1 == 0, then swap the order of the colors, and create a one-point radial, but that seems like overkill (and should be done in skia, not here, anyway).
Nico Weber
Comment 2 2010-07-04 11:21:00 PDT
dglazkov, you reviewed the patch that this patch is fixing. Can you take a look?
Dimitri Glazkov (Google)
Comment 3 2010-07-04 14:11:47 PDT
Comment on attachment 60473 [details] patch The change makes sense to me, but I have nits: * please make sure not to add any svn props * Please don't forget to check in test expectations as well as the new test. Are you sure there isn't a test that we're failing already?
Nico Weber
Comment 4 2010-07-04 14:22:12 PDT
Is it documented somwhere why svn props are not wanted? The first hit for "webkit svn props" gives me https://trac.macports.org/ticket/12594 , which suggests that the eol svn prop is wanted (?). As for test expectations, that's why I set cq- :-)
Nico Weber
Comment 5 2010-07-04 14:43:32 PDT
Also, `ack webkit-gradient LayoutTests/fst` shows that there's no existing test case for this.
Stephen White
Comment 6 2010-07-05 08:54:35 PDT
This looks wrong to me. As the comment says, the two-point radial gradient should only be invoked if the focal points are different (it really is much slower). Maybe I'm reading this wrong, but it seems like we'll be invoking it now for any m0 > 0, simply because it handles reversed radii correctly. I think the other solution you suggested, of swapping the colours and radii is preferable.
Nico Weber
Comment 7 2010-07-05 08:58:07 PDT
But the single-point radial gradient can't handle the case where both radii are > 0. (Also, this is an optimization that should be done in skia's SkGradientShader::CreateTwoPointRadial() function :-P)
Stephen White
Comment 8 2010-07-05 09:05:48 PDT
Hmm. I guess it's only the (r0, 0) radii case that this will really punish, performance-wise -- the others (where r1 > 0 also) weren't working anyway. Is that correct? OK. I'd still rather it swap and do the fast case, though. But feel free to submit that optimization to Skia instead. :)
Nico Weber
Comment 9 2010-07-05 09:35:30 PDT
How about we check this in as-is, then I submit a patch to skia that does the swapping and all these checks in SkGradientShader::CreateTwoPointRadial(), and then I optimization from here?
Stephen White
Comment 10 2010-07-05 10:07:28 PDT
(In reply to comment #9) > How about we check this in as-is, then I submit a patch to skia that does the swapping and all these checks in SkGradientShader::CreateTwoPointRadial(), and then I optimization from here? Sounds great.
Nico Weber
Comment 11 2010-07-05 21:21:32 PDT
Created attachment 60580 [details] patch Removed the svn:eol-style, and I think test expectations should be fine. I would still appreciate answers to my question about eol-style above.
Adam Barth
Comment 12 2010-07-07 03:31:29 PDT
> Is it documented somwhere why svn props are not wanted? I think it's been discussed on webkit-dev, but I don't remember the details. Sorry that's not a very helpful answer.
Dimitri Glazkov (Google)
Comment 13 2010-07-07 08:40:49 PDT
Comment on attachment 60580 [details] patch ok.
Peter Kasting
Comment 14 2010-07-07 11:21:35 PDT
For the record, Darin Adler has explicitly told me we want svn:eol-style on all files, and that he's gone through a couple times and added it in the past. So I'm not sure where this "don't add svn props" is coming from, and I think the patch with the props should be the committed one.
WebKit Commit Bot
Comment 15 2010-07-07 21:07:44 PDT
Comment on attachment 60580 [details] patch Clearing flags on attachment: 60580 Committed r62753: <http://trac.webkit.org/changeset/62753>
WebKit Commit Bot
Comment 16 2010-07-07 21:07:49 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 17 2010-07-08 15:59:48 PDT
I'm adding mac results, but the test is not good; the pixel results are chopped off. See attachment.
Simon Fraser (smfr)
Comment 18 2010-07-08 16:00:10 PDT
Created attachment 60977 [details] Pixel result, showing truncation
Nico Weber
Comment 19 2010-07-08 16:17:06 PDT
Created attachment 60979 [details] better test
Nico Weber
Comment 20 2010-07-08 16:22:11 PDT
Comment on attachment 60979 [details] better test Missing pixel results
Nico Weber
Comment 21 2010-07-08 16:46:06 PDT
Nico Weber
Comment 22 2010-07-09 09:29:44 PDT
Reopening, so that cq picks up patch.
WebKit Commit Bot
Comment 23 2010-07-09 12:54:09 PDT
Comment on attachment 60984 [details] Patch Clearing flags on attachment: 60984 Committed r62981: <http://trac.webkit.org/changeset/62981>
WebKit Commit Bot
Comment 24 2010-07-09 12:54:16 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.