Skip to content
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

Tweak blur filter so the result is close to gecko. #1920

Merged
merged 1 commit into from Oct 26, 2017

Conversation

@mephisto41
Copy link
Contributor

mephisto41 commented Oct 24, 2017

We actually pass the std deviation into cs_blur shader for gaussian
blur. So, correct some naming which causing confusion. Also, according
to the spec, the std deviation of box and text shadow is half of blur
radius.

Here are some gecko try for comparison.
With this patch

Without this patch

r? @glennw


This change is Reviewable

@glennw
Copy link
Member

glennw commented Oct 24, 2017

Nice work!

There is a CI failure in the shader validation - you can test this locally by running cargo test in the root webrender directory.

We should also do a gecko try run with this to see what effect it has on all the existing tests.

@mephisto41 mephisto41 force-pushed the mephisto41:improve-blur branch from 85dd6b7 to 8a92e5f Oct 24, 2017
@mephisto41
Copy link
Contributor Author

mephisto41 commented Oct 24, 2017

Thanks. I have fixed the shader validation.

gecko try is here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9311537999c72f68f92dc4912ce9f576776a5abf&selectedJob=139079239

Only fuzzy changes required I think.

@kvark
Copy link
Member

kvark commented Oct 24, 2017

Travis seems OK:

No output has been received in the last 10m0s

Taskcluster is showing one of the reftest failures: https://tools.taskcluster.net/groups/EtuwFR_uQd-l9S7d7QDiow/tasks/EtuwFR_uQd-l9S7d7QDiow/runs/0/logs/public%2Flogs%2Flive.log#L1152

Also, I suppose this fixes #1827

@glennw
Copy link
Member

glennw commented Oct 24, 2017

@mephisto41 For some reason, the TaskCluster CI often seems to require slightly more fuzziness than the Travis CI. It might just be a case of looking at the TC logs and updating the fuzziness on that one wrench test that is failing.

@glennw
Copy link
Member

glennw commented Oct 24, 2017

@mephisto41 It does look like quite a lot of unexpected fails on the try run - could you detail the ones that have changed and what the differences are?

@mephisto41 mephisto41 force-pushed the mephisto41:improve-blur branch from 8a92e5f to d56edf5 Oct 25, 2017
@mephisto41
Copy link
Contributor Author

mephisto41 commented Oct 25, 2017

@mephisto41 It does look like quite a lot of unexpected fails on the try run - could you detail the ones that have changed and what the differences are?

Yap, we have R3, R4 and R7 reftests failure. R3 has some box-shadow tests, R4 has both box-shadow and css blur filter tests and R7 has css blur filter tests.

We only need change the fuzzy value for those tests since we change the blur shader.

@glennw
Copy link
Member

glennw commented Oct 25, 2017

Most of them do appear to be fairly small differences. There's one (maybe in R7?) where one of the reftests has no blur but the reference has a blur.

I think this is probably OK to merge, if it makes the blur look closer to Gecko (I haven't checked that myself). But I'd like to get opinion from @staktrace first on whether those failures are reasonable to fuzz (for now).

@mephisto41
Copy link
Contributor Author

mephisto41 commented Oct 25, 2017

Ah, I saw it. it is in R4 (mix-blend-mode-and-filter.html). I'll check it again to see if it is regressed by this patch. Thanks for reminder.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 25, 2017

The latest upstream changes (presumably #1923) made this pull request unmergeable. Please resolve the merge conflicts.

@mephisto41 mephisto41 force-pushed the mephisto41:improve-blur branch from d56edf5 to 3fa3c2b Oct 25, 2017
@mephisto41
Copy link
Contributor Author

mephisto41 commented Oct 25, 2017

mix-blend-mode-and-filter.html is regressed by gecko bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1370564). Not this bug, I think this bug is ready to go. I'll create a gecko bug for fixing mix-blend-mode-and-filter.html.

@staktrace
Copy link
Contributor

staktrace commented Oct 25, 2017

gecko try is here: https://treeherder.mozilla.org/#/jobs?repo=try&
revision=9311537999c72f68f92dc4912ce9f576776a5abf&selectedJob=139079239

Yeah it looked like the only non-fuzzy change here was mix-blend-mode-and-filter.html which already got annotated in m-c via bug 1370564. The rest of these changes look fine to me.

@glennw
Copy link
Member

glennw commented Oct 25, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Oct 25, 2017

📌 Commit 3fa3c2b has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Oct 25, 2017

Testing commit 3fa3c2b with merge b04278f...

bors-servo added a commit that referenced this pull request Oct 25, 2017
Tweak blur filter so the result is close to gecko.

We actually pass the std deviation into cs_blur shader for gaussian
blur. So, correct some naming which causing confusion. Also, according
to the spec, the std deviation of box and text shadow is half of blur
radius.

Here are some gecko try for comparison.
[With this patch](https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/TTHMc9DqR-m6i0qnZo5oCw/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1)

[Without this patch](https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/JureAaHrT2qty-tYG0BOHg/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1)

r? @glennw

<!-- 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/1920)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 25, 2017

💔 Test failed - status-appveyor

@glennw
Copy link
Member

glennw commented Oct 25, 2017

@mephisto41 Looks like this has compile errors as a result of some other PRs that landed in the meantime, so will need to be updated, sorry!

We actually pass the std deviation into cs_blur shader for gaussian
blur. So, correct some naming which causing confusion. Also, according
to the spec, the std deviation of box and text shadow is half of blur
radius.
@mephisto41 mephisto41 force-pushed the mephisto41:improve-blur branch from 3fa3c2b to e1f0c80 Oct 26, 2017
@mephisto41
Copy link
Contributor Author

mephisto41 commented Oct 26, 2017

I've updated the changesets.

@@ -1861,10 +1862,12 @@ impl FrameBuilder {
match *filter {
FilterOp::Blur(blur_radius) => {
let blur_radius = device_length(blur_radius, device_pixel_ratio);
let blur_std_deviation = blur_radius.0 as f32;

This comment has been minimized.

@glennw

glennw Oct 26, 2017

Member

This doesn't seem right - the std deviation shouldn't be the same as the blur radius?

This comment has been minimized.

@mephisto41

mephisto41 Oct 26, 2017

Author Contributor

I know this is confusing. But for css blur filter, the blur radius is the std deviation. See the spec https://drafts.fxtf.org/filter-effects/#FilterProperty

"Applies a Gaussian blur to the input image. The passed parameter (the radius) defines the value of the standard deviation to the Gaussian function."

@glennw
glennw approved these changes Oct 26, 2017
@glennw
Copy link
Member

glennw commented Oct 26, 2017

Ah, right. Thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Oct 26, 2017

📌 Commit e1f0c80 has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Oct 26, 2017

Testing commit e1f0c80 with merge c47d106...

bors-servo added a commit that referenced this pull request Oct 26, 2017
Tweak blur filter so the result is close to gecko.

We actually pass the std deviation into cs_blur shader for gaussian
blur. So, correct some naming which causing confusion. Also, according
to the spec, the std deviation of box and text shadow is half of blur
radius.

Here are some gecko try for comparison.
[With this patch](https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/TTHMc9DqR-m6i0qnZo5oCw/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1)

[Without this patch](https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/JureAaHrT2qty-tYG0BOHg/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1)

r? @glennw

<!-- 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/1920)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 26, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: glennw
Pushing c47d106 to master...

@bors-servo bors-servo merged commit e1f0c80 into servo:master Oct 26, 2017
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.