Specify an ImageRendering for WebRenderCanvasLayer and WebRenderImageLayer

RESOLVED FIXED in mozilla54

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: rhunt, Assigned: rhunt)

Tracking

(Blocks: 1 bug)

unspecified
mozilla54
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
A couple of reftests rely on the image-rendering attribute which changes mSamplingFilter on ImageLayer and mFlags on CanvasLayer to use a POINT filter. WebRender supports an ImageRendering enum to specify this, but we currently default it to Auto (or Linear).
(Assignee)

Comment 1

2 years ago
I currently have a patch of this that is working, but it relies on an updated version of WebRender.
Depends on: 1329574

Comment 2

2 years ago
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/projects/graphics/rev/4328c358a7c1
Specify an ImageRendering for some WebRenderLayers r=kats
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED

Comment 3

2 years ago
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/projects/graphics/rev/66ef32af3d41
Mark 8 reftests as passing. r=kats? DONTBUILD
This line looks wrong, shouldn't it be a & instead of | ?

https://hg.mozilla.org/projects/graphics/rev/4328c358a7c1e7fbd9536a82a3372dc69fe10633#l5.17
Flags: needinfo?(rhunt)
(Assignee)

Comment 5

2 years ago
Yes that is definitely wrong. I'm incredibly surprised that it works, and especially passes image rendering tests.

It doesn't seem to be harmful right now, so I'll look into it tonight. If it causes a problem we can back it out.
Flags: needinfo?(rhunt)
(Assignee)

Comment 6

2 years ago
So using | with a bit flag of course causes the conditional to always be true. This is causing us to use a point filter all the time. Additionally I don't believe we should be checking for USE_NEAR_FILTER, as it seems that mSamplingFilter is used instead. ImageLayer was coded correctly.

With these fixes some tests are failing. So it seems like always using a point filter on canvases is good enough for some tests. I'll need to look into it more.

If there isn't an obvious fix, it may be worth it to backout as WR's texture cache allocates a new page for every point filter request. If everything uses point filters, it could slow things down for no good reason.
(Assignee)

Comment 7

2 years ago
Created attachment 8828493 [details] [diff] [review]
fix-tf1.patch

This fixes the WrTextureFilter that we use in WrCanvasLayer.

The reason this took so long is that I was investigating reftest failures with this change on my local machine.

It turns out that my high dpi screen was causing linear filtering to fail certain tests. Turning down the resolution and dpi fixed this. Automation doesn't seem to have this problem either.

This seems like a bug to me, but for now it should be safe to fix.
Attachment #8828493 - Flags: review?(bugmail)
(Assignee)

Comment 8

2 years ago
Created attachment 8828494 [details] [diff] [review]
fix-tf2.patch

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7a76a937a73ac2ba4d100e0c4611e8e1f6415278&selectedJob=70264338

There is one test failure with this patch applied that needs to be marked as a fails-if(webrender).

Investigating the failure it's due to us not supporting pixel snapping with our transforms. Using a point filter caused us to pass when we shouldn't have.

I will file a followup bug to fix pixel snapping.
Attachment #8828494 - Flags: review?(bugmail)
(Assignee)

Updated

2 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #8828493 - Flags: review?(bugmail) → review+
Attachment #8828494 - Flags: review?(bugmail) → review+
(Assignee)

Comment 9

2 years ago
https://hg.mozilla.org/projects/graphics/rev/9d76d2e4cde6
https://hg.mozilla.org/projects/graphics/rev/1d0fc06a5a04
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.