Closed Bug 1447880 Opened 2 years ago Closed 2 years ago

blob-image: Use clipping when possible for nsDisplayMask

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Currently we take a bad DrawItemAsLayer path. In the cases where we can get an actual clip path we should use that instead.
Blocks: 1447778
nsSVGIntegrationUtils::PaintMaskAndClipPath() should be using a clip path when possible. See "MaskUsage"
If we take some pieces of PaintMaskAndClipPath() we should be able to do regular clipping for clip paths.

Also, the layer building/paint as layers stuff shows up in profiles:
https://perfht.ml/2qJFmZ6
We can use nsDisplayMask::PaintMask and PushLayer/PopLayer for the cases where we don't have a clip path.
Blocks: 1478078
Assignee: nobody → kmadan
Blocks: 1477373
Assignee: kshvmdn → jmuizelaar
This will need some kind of solution for handing 3d transforms inside of masks. That could be just making those masks active.
3d transforms inside of masks can be handled with BasicLayerManager.

It should be that the frame for the nsDisplayMask gets marked as invalid when the mask changes.

We should be able to chop PaintMaskAndClipPath in half if we can get control of the state that it needs between starting the clip and ending the clip.
Attached patch WIPSplinter Review
It isn't possible to trigger this code currently because
the only way to have an inactive 3d transform is with a mask
or filter item and those get handled with a BasicLayerManager.

This becomes necessary once we handle mask items internally.
This allows us to invalidate individual items inside of the mask instead of
treating the mask and it's children as a single item.

Depends on 6223
Comment on attachment 9010127 [details]
Bug 1447880. Paint nsDisplayMasks directly instead of using a BasicLayerManager

Markus Stange [:mstange] has approved the revision.
Attachment #9010127 - Flags: review+
This pulls out a nsDisplayMask::Valid that can be used by
blob invalidation to ensure that the mask is drawable.
Attachment #9010993 - Attachment description: Bug 1447880. Add nsDisplayMask::Valid → Bug 1447880. Add nsDisplayMask::IsValidMask
Comment on attachment 9010993 [details]
Bug 1447880. Add nsDisplayMask::IsValidMask

Markus Stange [:mstange] has approved the revision.
Attachment #9010993 - Flags: review+
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4f0db2886781
Handle inactive 3d transforms. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/78784961fe2c
Allow PaintMaskAndClipPath to support different ways of painting its children. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3136af29c89
Add nsDisplayMask::IsValidMask. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/5cd110df8612
Paint nsDisplayMasks directly instead of using a BasicLayerManager. r=mstange
Depends on: 1493616
You need to log in before you can comment on or make changes to this bug.