New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix start and end points for linear gradients with angle specified. #8094
Conversation
Previously, this was most noticeable with 45deg gradients, where the gradient would end too early, and the remainder was filled with a solid color. (This also fixes gradients on webrender, which relies on the start and stop points being correct).
r? @pcwalton |
Is there any way to write a reftest for this? |
Not that I could think of. |
How about a not-ref? |
The only ways I can think of to reftest this (with our current infrastructure) would rely on exact pixel accuracy on all platforms between two different features (such as a gradient with a css transform). I don't think we can rely on this being consistent on all platforms and renderer backends. The best way long term would be if we could support tests that dump the display list to text and compare that to an expected reference I think. Any thoughts @pcwalton ? |
(And I don't know what you'd compare against in a != test that would actually make for a useful test). |
Yeah, I'm at a loss as to how to reftest this. You could try to do it with a degenerate gradient with a sharp color transition compared against a solid box with a rotation transform, but pixel accuracy issues are likely going to ruin that. |
OK, I tried to do that, but I can't get them to match pixel for pixel. Can we land this without a test? It's a strict improvement on what's there now. Additionally, when webrender lands - it does fail reftests without this change (since it implements gradients in a different way). |
@bors-servo: r+ |
📌 Commit 113778a has been approved by |
Fix start and end points for linear gradients with angle specified. Previously, this was most noticeable with 45deg gradients, where the gradient would end too early, and the remainder was filled with a solid color. (This also fixes gradients on webrender, which relies on the start and stop points being correct). <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8094) <!-- Reviewable:end -->
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
Previously, this was most noticeable with 45deg gradients, where the gradient would end too early, and the remainder was filled with a solid color.
(This also fixes gradients on webrender, which relies on the start and stop points being correct).