Distorted images in v57 nightly

RESOLVED FIXED in Firefox 57



a year ago
a year ago


(Reporter: ssidpat, Assigned: dvander)


57 Branch

Firefox Tracking Flags

(firefox57 fixed)


(Whiteboard: [gfx-noted])


(5 attachments)



a year ago
Created attachment 8904156 [details]
Firefox v57 nightly - Distorted images.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170903220032

Steps to reproduce:

Browse to https://qz.com/latest/
Scroll to about half way in the page
Move your mouse from one story to another

Actual results:

The small images next to the story become distorted with strange banding effect

Expected results:

Images should not be distorted, which I'm moving the mouse or scrolling  a web page.

Additional information:
* Sometimes scrolling up and down the page makes the image reappear as normal again.
* From what I can tell there is some sort of mouse hover effect on the qz.com site, which seems to trigger this behavior. 
* QZ.com is the worst affected but I see similar behavior on Ars Technica article pages and on Plural Sight training videos. 
* This is happening on two completely different machines that are not synced via FF account and have different GPU hardware.
Component: Untriaged → Graphics
Product: Firefox → Core

Comment 1

a year ago

Could you test this with setting layers.mlgpu.dev-enabled = false in about:config (need to restart browser)?
Flags: needinfo?(ssidpat)

Comment 2

a year ago
I can't reproduce the problem after setting layers.mlgpu.dev-enabled=false.

It was set to true by default for me and if I set it back to true and restart the browser the problem returns on the same site.
Flags: needinfo?(ssidpat)

Comment 3

a year ago

Thanks, your confirmation,

Could you attach the result of about:support in the default setting here?
Blocks: 1375743
Flags: needinfo?(ssidpat)

Comment 4

a year ago
Created attachment 8904205 [details]
Firefox Nightly v57 Bug 1396507 - about-support.txt

Output from about:support attached as text file.
Flags: needinfo?(ssidpat)
This looks like an Advanced Layers bug.
Assignee: nobody → dvander
Whiteboard: [gfx-noted]
Ever confirmed: true
The bug is that an ImageLayer has a visible region starting at (0, -1). The old compositor ignores the visible region of images (except for occlusion culling), and uses the picture rect to draw. We already clamp visible regions to picture rects in other cases, so we might as well do it for ImageLayers too.

The reason this resulted in such whacky rendering is because we unconditionally call DecomposeIntoNoRepeatRects. The old compositor does this too, but never with a negative origin. The negative origin completely messed up the texture coordinates. There's no reason to call this function here, so I'll add a patch to fix that as well.
Created attachment 8907190 [details] [diff] [review]
part 1, fix image visible region

Clamp the visible region like we already do for video.
Attachment #8907190 - Flags: review?(matt.woodrow)
Created attachment 8907191 [details] [diff] [review]
part 2, clean-up

This is a straight-up refactoring, so we're not passing a million arguments into a bunch of functions. Instead there's a new struct to carry texture drawing information around. It'll be extended with a new field in the next patch.
Attachment #8907191 - Flags: review?(matt.woodrow)
Created attachment 8907192 [details] [diff] [review]
part 3, relax no-repeat rects

This drops the call to DecomposeIntoNoRepeatRects unless needed by its caller. Only PaintedLayers with MayResample() == true will require it. For PaintedLayers with MayResample() == false, there is a new SamplerMode::LinearRepeat so we can paint the entire texture with a single instance/draw call.
Attachment #8907192 - Flags: review?(matt.woodrow)
Attachment #8907190 - Flags: review?(matt.woodrow) → review+
Attachment #8907191 - Flags: review?(matt.woodrow) → review+
Attachment #8907192 - Flags: review?(matt.woodrow) → review+
status-firefox57: --- → affected
Priority: -- → P1

Comment 10

a year ago
Pushed by danderson@mozilla.com:
Clamp the visible region of ImageLayers to the picture rect. (bug 1396507 part 1, r=mattwoodrow)
Clean up how textured regions are added to draw calls. (bug 1396507 part 2, r=mattwoodrow)
Bypass DecomposeIntoNoRepeatRects when possible. (bug 1396507 part 3, r=mattwoodrow)
Last Resolved: a year ago
status-firefox57: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Duplicate of this bug: 1387281
You need to log in before you can comment on or make changes to this bug.