Closed Bug 1823578 Opened 2 years ago Closed 2 years ago

Add new clip-mask rendering path

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: gw, Assigned: gw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.

This adds the new infrastructure for rendering masked primitives
and uses it for simple rectangle primitives. Follow up patches
will port other primitives to it (and transformed rectangles).

Instead of rendering an alpha mask and then applying that during
picture cache rendering of content, the underlying content is
drawn to an off-screen surface, and the mask is applied on
top of that via multiplicative blending.

This is particularly helpful for applying masks to dynamically
rendered pictures in future, as we can apply the mask over the
already rendered picture without allocating an extra surface.

Since the content and mask is rendered together to a surface,
we can take advantage of this in future by caching the result
in the texture cache, rather than a temporary render target.
This means we don't need to redraw clip masks for this content
each time the surrounding area is invalidated.

Since the clip-mask is rendered in to the off-screen surface,
it is cheaper and simpler to composite the content in to the
main scene, avoiding an extra texture fetch and some tricky
fragment shader logic to sample the correct part of the mask.

To reduce the number of off-screen pixels that get drawn, the
system supports splitting the content up in to a series of
segments. This can either be a 9-patch, for the simple and
common case of a single rounded clip, or a tile grid across
the primitive. The tile grid can make it much faster to apply
large image masks, where there are often large areas that we
can determine are not affected by the mask image.

Blocks: 1823579
Assignee: nobody → gwatson
Status: NEW → ASSIGNED
Pushed by gwatson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4548910a12b0 Add new clip-mask rendering path r=gfx-reviewers,ahale
Regressions: 1827553
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Regressions: 1827645
Regressions: 1827648
Regressions: 1827652
Backout by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cfa3d7817675 Backed out changeset 4548910a12b0 as req by gwatson . CLOSED TREE
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 114 Branch → ---
Regressions: 1827711
Pushed by gwatson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1c58e8743220 Add new clip-mask rendering path r=gfx-reviewers,ahale
Regressed by: 1828419
No longer regressed by: 1828419
Regressions: 1828419
Regressions: 1798725
Regressions: 1828571
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Regressions: 1828798
Regressions: 1828799
Regressions: 1829027
Regressions: 1829487
Regressions: 1830588
Depends on: 1836052
Regressions: 1840211
Regressions: 1840214
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: