Closed Bug 1524117 Opened 4 years ago Closed 4 years ago

Skip mix-blend modes when we're blending on top of transparency

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

Attachments

(2 files)

From the formula at https://drafts.fxtf.org/compositing-1/#generalformula

If the backdrop alpha is 0 (as it will be if the mix-blend mode container is the first primitive in a stacking context), then the blend mode parameter gets multiplied by 0, and no longer matters.

We can do less work in some cases because of this.

Hoving over client logos on singlesprout.com GPU time goes from 2ms -> 1.4ms on my machine with this.

Blocks: 1519718
No longer depends on: 1519718
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/869fbaef1042
Skip mix-blend mode operators in WebRender if we're sure they won't have any effect. r=gw
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1f1e882ed243
Skip mix-blend mode operators in WebRender if we're sure they won't have any effect. r=gw
https://hg.mozilla.org/integration/autoland/rev/4224ec9c27d3
Remove special handling for mix-blend modes on the root WebRender stacking context, since Gecko handles this already. r=gw
Flags: needinfo?(matt.woodrow)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.