Closed Bug 1476058 Opened 6 years ago Closed 6 years ago

Optimize away fully-transparent blob images

Categories

(Core :: Graphics: WebRender, enhancement, P2)

Other Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: kats, Assigned: Gankra)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

It seems like we often create blob images that are fully transparent. We should stop doing that.

At least one source of such blobs is if you have a XUL image element with a background but nothing else. The XULImage display item returns false from [1] which makes us go down the fallback path which doesn't draw anything.

There might be other sources of blobs. The way I see them is grab a WR capture, and look at the blobs/ folder. If the blob just a bunch of zeros then it's fully transparent.

[1] https://searchfox.org/mozilla-central/rev/b0275bc977ad7fda615ef34b822bba938f2b16fd/layout/xul/nsImageBoxFrame.cpp#555
https://mozilla.staktrace.com/raw-renderer.html (which will be available whenever github resolves their current issues and rebuilds the site) can be used to render the .raw files. You can usually the width/height info in one of the .ron files.
Priority: -- → P2
I think this should be fixed on a case-by-case basis: If a display item is returning false from CreateWebRenderCommands but then doesn't paint anything, that's a good sign that it should have returned true.
Agreed
Assignee: nobody → a.beingessner
Comment on attachment 8994581 [details]
Bug 1476058 - consider no image to be successful for wr.

https://reviewboard.mozilla.org/r/259122/#review266320

We may need to make a similar change in nsDisplayImage::CreateWebRenderCommands.
Attachment #8994581 - Flags: review?(aosmond) → review+
Keywords: checkin-needed
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b09ee6fada54
consider no image to be successful for wr. r=aosmond
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b09ee6fada54
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: