Closed Bug 1522021 Opened 6 years ago Closed 6 years ago

Propagate input size to CreateSimilarDrawTarget for filters

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(4 files, 3 obsolete files)

The basic idea here is to add a CreateSimilarDrawTargetForFilter(format, size, FilterNode *filter) that we record instead of CreateSimilarDrawTarget().
When we playback CreateSimilarDrawTargetForFilter we'll do something similar to CreateClippedDrawTarget and compute an actual size that we want to use for the input surface. We do this by adding a method to FilterNode called IntRect MapRectToSource(aRect, aMax). The default implementation of this method returns aMax which is the size passed to CreateSimilarDrawTargetForFilter. Individual FilterNodes can return a rect that is contained by aMax.

FilterNodeComponentTransferSoftware will just call MapRectToSource() on it's inputs. If an input is a SourceSurface we return the rect and so we are able to get a smaller size for when we create the similar draw target.

Blocks: 1494924
Attached patch A sketch of what this would look like (obsolete) (deleted) — Splinter Review

We end up having to do some gymnastics to build the filter chain before attaching the source, but I think it works out.

Assignee: nobody → jmuizelaar
Attachment #9038423 - Flags: feedback?(mstange)
Attached patch Second version (obsolete) (deleted) — Splinter Review
Attachment #9038423 - Attachment is obsolete: true
Attachment #9038423 - Flags: feedback?(mstange)
Attachment #9038428 - Flags: feedback?(mstange)
Attached file A version that builds (obsolete) (deleted) —
Attachment #9038428 - Attachment is obsolete: true
Attachment #9038428 - Flags: feedback?(mstange)
Priority: -- → P3

I have this basically working. There's a problem with subpixel offsets making tile borders visible. I'll need to better understand what's going on in ComputeEffectOffset to figure this out.

Attached patch A version that works (deleted) — Splinter Review
Attachment #9038444 - Attachment is obsolete: true
Attached patch Mostly done (deleted) — Splinter Review
Attachment #9039178 - Flags: review?(mstange)

This lets us avoid drawing the complete input for ever tile when
drawing filters into a tile.

This forwards to an underlying source surface but also has an origin that it
uses to correctly return results from GetRect()

Attachment #9039178 - Flags: review?(mstange)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Pushed by jmuizelaar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3c9634352cd6 Propagate input size to CreateSimilarDrawTarget for filters. r=mstange
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: