Propagate input size to CreateSimilarDrawTarget for filters

RESOLVED FIXED in Firefox 66

Status

()

enhancement
P3
normal
RESOLVED FIXED
6 months ago
4 months ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

(Blocks 1 bug)

unspecified
mozilla66
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(4 attachments, 3 obsolete attachments)

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

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)
Posted patch Second version (obsolete) — Splinter Review
Attachment #9038423 - Attachment is obsolete: true
Attachment #9038423 - Flags: feedback?(mstange)
Attachment #9038428 - Flags: feedback?(mstange)
Posted file A version that builds (obsolete) —
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.

Attachment #9038444 - Attachment is obsolete: true
Posted patch Mostly doneSplinter 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)
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ae9eadd86a7
Implement SourceSurfaceOffset. r=mstange
Status: NEW → RESOLVED
Closed: 6 months 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 months ago6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.