Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBox shadows with blur and spread increase the corner radius too much #2287
Comments
|
I discovered this on the box-shadow playground. |
|
What seems to be happening is that per spec we are adjusting the border radii of the rounded rect we are using for the shadow, but with a wrong spread value. |
|
That sounds like we're doing the adjustment twice instead of just once. |
|
Looks like it's a tad more complicated than my hunch above. One thing that strikes me as odd is that the rounded rect that we send to the shader has the correct adjusted border radii, but unadjusted rectangle dimensions. Yet the final blurred rectangle gets drawn at the correct size later and I haven't seen where the dimensions are adjusted. In any case the rectangle that is blurred out has a mismatch between the actual size and the radii and I am pretty sure the problem is there. |
Fix incorrect border radius with outset shadows. Fixes #2287. The problem was that if the blur radius/corners are big enough we blur the entire rounded rectangle. In this case we need to make sure that the blurred rectangle takes the spread amount into account (while this is not necessary when using the nine-patch code path where the rectangular patches can be stretched). This PR adjusts the size of the rounded rectangle primitive accordingly when it makes sense. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2308) <!-- Reviewable:end -->
Fix incorrect border radius with outset shadows. Fixes #2287. The problem was that if the blur radius/corners are big enough we blur the entire rounded rectangle. In this case we need to make sure that the blurred rectangle takes the spread amount into account (while this is not necessary when using the nine-patch code path where the rectangular patches can be stretched). This PR adjusts the size of the rounded rectangle primitive accordingly when it makes sense. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2308) <!-- Reviewable:end -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1429793
Testcase
This shadow has a spread radius.
When the shadow has no blur, then the shadow's corner radius is correct. But if it does have a blur, then the corner radius is too large.
Expected vs actual results: