Closed Bug 1328893 Opened 6 years ago Closed 6 years ago

Specify an ImageRendering for WebRenderCanvasLayer and WebRenderImageLayer


(Core :: Graphics: WebRender, defect)

Not set





(Reporter: rhunt, Assigned: rhunt)


(Blocks 1 open bug)



(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
Specify an ImageRendering for some WebRenderLayers r=kats
Closed: 6 years ago
Resolution: --- → FIXED
Pushed by
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

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)
Resolution: FIXED → ---
Attachment #8828493 - Flags: review?(bugmail) → review+
Attachment #8828494 - Flags: review?(bugmail) → review+
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.