Closed Bug 1328893 Opened 3 years ago Closed 3 years ago

Specify an ImageRendering for WebRenderCanvasLayer and WebRenderImageLayer

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla54

People

(Reporter: rhunt, Assigned: rhunt)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

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).
I currently have a patch of this that is working, but it relies on an updated version of WebRender.
Depends on: 1329574
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/projects/graphics/rev/4328c358a7c1
Specify an ImageRendering for some WebRenderLayers r=kats
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/projects/graphics/rev/66ef32af3d41
Mark 8 reftests as passing. r=kats? DONTBUILD
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)
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.
Attached patch fix-tf1.patchSplinter Review
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)
Attached patch fix-tf2.patchSplinter Review
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)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/projects/graphics/rev/9d76d2e4cde6
https://hg.mozilla.org/projects/graphics/rev/1d0fc06a5a04
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.