blob-image: Use clipping when possible for nsDisplayMask

RESOLVED FIXED in Firefox 64

Status

()

enhancement
P2
normal
RESOLVED FIXED
Last year
19 days ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

(Blocks 1 bug)

unspecified
mozilla64
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(5 attachments)

Currently we take a bad DrawItemAsLayer path. In the cases where we can get an actual clip path we should use that instead.
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.
Assignee: nobody → kmadan
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.
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+

Comment 16

9 months ago
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
You need to log in before you can comment on or make changes to this bug.