Bug 41580 - [chromium] Fix radial gradients
Summary: [chromium] Fix radial gradients
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-04 11:04 PDT by Nico Weber
Modified: 2010-07-09 12:54 PDT (History)
6 users (show)

See Also:


Attachments
patch (4.50 KB, patch)
2010-07-04 11:11 PDT, Nico Weber
dglazkov: review-
thakis: commit-queue-
Details | Formatted Diff | Diff
patch (4.33 KB, patch)
2010-07-05 21:21 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Pixel result, showing truncation (74.46 KB, image/png)
2010-07-08 16:00 PDT, Simon Fraser (smfr)
no flags Details
better test (1.90 KB, patch)
2010-07-08 16:17 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Patch (168.20 KB, patch)
2010-07-08 16:46 PDT, Nico Weber
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2010-07-04 11:04:32 PDT
http://crbug.com/48280
Comment 1 Nico Weber 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).
Comment 2 Nico Weber 2010-07-04 11:21:00 PDT
dglazkov, you reviewed the patch that this patch is fixing. Can you take a look?
Comment 3 Dimitri Glazkov (Google) 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?
Comment 4 Nico Weber 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- :-)
Comment 5 Nico Weber 2010-07-04 14:43:32 PDT
Also, `ack webkit-gradient LayoutTests/fst` shows that there's no existing test case for this.
Comment 6 Stephen White 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.
Comment 7 Nico Weber 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)
Comment 8 Stephen White 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.  :)
Comment 9 Nico Weber 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?
Comment 10 Stephen White 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.
Comment 11 Nico Weber 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.
Comment 12 Adam Barth 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.
Comment 13 Dimitri Glazkov (Google) 2010-07-07 08:40:49 PDT
Comment on attachment 60580 [details]
patch

ok.
Comment 14 Peter Kasting 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.
Comment 15 WebKit Commit Bot 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>
Comment 16 WebKit Commit Bot 2010-07-07 21:07:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Simon Fraser (smfr) 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.
Comment 18 Simon Fraser (smfr) 2010-07-08 16:00:10 PDT
Created attachment 60977 [details]
Pixel result, showing truncation
Comment 19 Nico Weber 2010-07-08 16:17:06 PDT
Created attachment 60979 [details]
better test
Comment 20 Nico Weber 2010-07-08 16:22:11 PDT
Comment on attachment 60979 [details]
better test

Missing pixel results
Comment 21 Nico Weber 2010-07-08 16:46:06 PDT
Created attachment 60984 [details]
Patch
Comment 22 Nico Weber 2010-07-09 09:29:44 PDT
Reopening, so that cq picks up patch.
Comment 23 WebKit Commit Bot 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>
Comment 24 WebKit Commit Bot 2010-07-09 12:54:16 PDT
All reviewed patches have been landed.  Closing bug.