Closed Bug 1474466 Opened Last year Closed Last year

Avoid clipping to rounded rects and use them as a path if possible

Categories

(Core :: Web Painting, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Details

Attachments

(1 file)

D2D is particularly if given a non-rectangular clip, but it can usually draw complex geometry quickly.

We should try optimizing simple cases that use a rounded rect clip to draw a color into using the rounded rect as the fill geometry.
This fails quite a few reftests since the rendering of a rounded path is subtly different to the rendering of a rounded clip.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f162d5ac78af388460b17865af15c527573ca0be&selectedJob=187096017

I've fuzzed the normal reftests, but I'm not sure how to that for the WPT failures.

James, is it possible to mark the WPT failures as fuzzy somehow? They all look identical, just subtle color differences on the rounded corners.
Flags: needinfo?(james)
Not yet, but fixing that is a high priority so it should be possible in a couple of months. The main blocker is just coming up with a design for storing the fuzzy annotations that works with the wpt metadata.
Flags: needinfo?(james)
Comment on attachment 8990851 [details]
Bug 1474466 - Convert rounded rect clips into paint geometry if the display item type support it.

https://reviewboard.mozilla.org/r/255866/#review263594

::: layout/painting/nsDisplayList.cpp:4809
(Diff revision 2)
> +                                                  A2D,
> +                                                  roundedRect[0]);
> +    aCtx->SetPath(path);
> +  }
> +
> +  aCtx->Fill();

If we choose to use the gfxContext here instead of accessing the DrawTarget directly (not sure that that's wise), we'll want to call aCtx->NewPath() here probably so that if someone does a SeTransform we don't risk the context doing lots of work.

In general though I'd expect using the DT directly here to be significantly better, the gfxContext save/restore code has been showing up in profiles on MotionMark.
Attachment #8990851 - Flags: review?(bas) → review+
Comment on attachment 8990851 [details]
Bug 1474466 - Convert rounded rect clips into paint geometry if the display item type support it.

https://reviewboard.mozilla.org/r/255866/#review263596
Comment on attachment 8990851 [details]
Bug 1474466 - Convert rounded rect clips into paint geometry if the display item type support it.

https://reviewboard.mozilla.org/r/255866/#review263702
Attachment #8990851 - Flags: review+
Attachment #8990851 - Flags: review?(mikokm)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/90c347a61bd5
Convert rounded rect clips into paint geometry if the display item type support it. r=bas,jnicol
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0841c88d3ae
Properly clear associated ShadowRoot from StyleSheet objects. r=smaug
(In reply to Pulsebot from comment #11)
> Pushed by emilio@crisal.io:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/e0841c88d3ae
> Properly clear associated ShadowRoot from StyleSheet objects. r=smaug

This landed with the wrong bug number and I backed it out in https://hg.mozilla.org/integration/mozilla-inbound/rev/0dfb0b5f6a95, sorry for the noise.
https://hg.mozilla.org/mozilla-central/rev/90c347a61bd5
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.