Closed Bug 1396507 Opened 7 years ago Closed 7 years ago

Distorted images in v57 nightly

Categories

(Core :: Graphics, defect, P1)

57 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: ssidpat, Assigned: dvander)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(5 files)

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
@sid,

Could you test this with setting layers.mlgpu.dev-enabled = false in about:config (need to restart browser)?
Flags: needinfo?(ssidpat)
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)
@sid,

Thanks, your confirmation,

Additionally, 
Could you attach the result of about:support in the default setting here?
Blocks: 1375743
Flags: needinfo?(ssidpat)
Output from about:support attached as text file.
Flags: needinfo?(ssidpat)
This looks like an Advanced Layers bug.
Assignee: nobody → dvander
Whiteboard: [gfx-noted]
Status: UNCONFIRMED → ASSIGNED
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.
Clamp the visible region like we already do for video.
Attachment #8907190 - Flags: review?(matt.woodrow)
Attached patch part 2, clean-upSplinter Review
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)
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+
Pushed by danderson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8bec33a87cc7
Clamp the visible region of ImageLayers to the picture rect. (bug 1396507 part 1, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/44c703889755
Clean up how textured regions are added to draw calls. (bug 1396507 part 2, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/400e455a06da
Bypass DecomposeIntoNoRepeatRects when possible. (bug 1396507 part 3, r=mattwoodrow)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: