Closed Bug 1401653 Opened 6 years ago Closed 6 years ago

wr-text: implement decoration fusion(?)


(Core :: Graphics: WebRender, defect, P1)




Tracking Status
firefox57 --- unaffected
firefox58 --- unaffected


(Reporter: Gankra, Assigned: Gankra)


(Blocks 1 open bug)


(Whiteboard: [wr-reserve] [gfx-noted])


(2 files)

These two reftests fail with webrendest layers-free. They appear to be testing some sort of "decoration fusion" behaviour, that I don't really understand yet.

Hey jonathan, any idea what these tests are about?
Flags: needinfo?(jfkthame)
It looks like they're testing how decorations (particularly "complex" ones -- dotted, dashed or wavy lines) are drawn across element boundaries, to check that we don't get discontinuities in what should be a continuous line, and that the decorations are offset appropriately in response to position:relative and shadow offsets.

What do the failures you're seeing look like? Do there seem to be glitches at the boundaries between various <span>s in the testcases?
Flags: needinfo?(jfkthame)
Attached image decorations.png
The decorations seem to have overlapping ranges, and get all messed up. It's possible we need to be drawing the decorations so that this overlap is invisible? That or my code to grab the bounds of the lines is wrong (very possible).
The overlaps are one issue, but in addition the various parts seem to be out of phase with each other.
Well each decoration starts at the same position, which seemed to be what gecko did. Is the period of the decoration required to satisfy some specific relationship with its height (thickness) to make this Just Work?
Priority: -- → P3
Whiteboard: [gfx-noted]
Priority: P3 → P2
Whiteboard: [gfx-noted] → [wr-mvp] [gfx-noted]
Blocks: 1407627
Summary: text-layers: implement decoration fusion(?) → wr-text: implement decoration fusion(?)
Finally figured out what's going on here. Gecko is being Very Smart in its line drawing code, and we're breaking the assumptions there. Basically gecko tries to align periodic patterns to a period-multiple offset from some parent element. Then applies clips to keep lines from smashing into eachother. This creates the illusion of a single coherent line across elements and style changes.

This not working with WR is a mix of three issues:

* Upstream wr doesn't currently match up its wavy/dashed line period with gecko's
* We don't push/pop clips for TextDrawTarget (before this was hard, now it's easy)
* I didn't actually pass the right dimensions for wavy lines from gecko to wr (so if we did apply the clip, we get bad results)
Priority: P2 → P3
Whiteboard: [wr-mvp] [gfx-noted] → [wr-reserve] [gfx-noted]
I was already working on this before it was marked as P3.
Assignee: nobody → a.beingessner
Comment on attachment 8921639 [details]
Bug 1401653 - fixup webrender text-decoration bindings.
Attachment #8921639 - Flags: review?(jmuizelaar) → review+
Try build to make sure there's no collateral damage (I don't expect any):
Priority: P3 → P1
Whiteboard: [wr-reserve] [gfx-noted] → [wr-mvp] [gfx-noted]
Try looks good.
Keywords: checkin-needed
You should upgrade your cbindgen to .26 or newer; I think a bunch of the generated changes in this patch are artifacts of your using the older cbindgen.
Blocks: 1403261
Pushed by
fixup webrender text-decoration bindings. r=jrmuizel
Keywords: checkin-needed
API change landed before me, fixed (added two Nothings to the call)
Flags: needinfo?(a.beingessner)
Pushed by
fixup webrender text-decoration bindings. r=jrmuizel
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Whoops, forgot to reopen this bug -- all the work in gecko is done, but upstream webrender work needs to get done to fix one of the cases in these tests and make them actually pass.

Specifically needs to get fixed.

Fixing the linked issue will now also fix text-shadow/decorations-multiple-zorder.html since Bug 1399310 just landed, making us use clipped decorations in more places.
Resolution: FIXED → ---
Deprioritized to P3 during triage - moving to Reserve Backlog.
Assignee: a.beingessner → nobody
Priority: P1 → P3
Whiteboard: [wr-mvp] [gfx-noted] → [wr-reserve] [gfx-noted]
Gankro, what's the status of this bug?
Flags: needinfo?(a.beingessner)
bugs fixed; tests just need minor fuzzing, looks like
Flags: needinfo?(a.beingessner)
opening new bug for test expectations
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Blocks: 1455365
Assignee: nobody → a.beingessner
You need to log in before you can comment on or make changes to this bug.