Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrible performance on giant dotted and dashed border corners #2712

Closed
mrobinson opened this issue May 1, 2018 · 3 comments
Closed

Terrible performance on giant dotted and dashed border corners #2712

mrobinson opened this issue May 1, 2018 · 3 comments

Comments

@mrobinson
Copy link
Member

@mrobinson mrobinson commented May 1, 2018

When dotted and dashed border corners use very, very shallow angles, they create hundreds or thousands of dots and dashes. This leads to very bad performance. We should work to improve this situation. Some examples of web content that produces this issue are:

<span style="border-radius:50%;border:dashed;display:inline-block;width:115001px">xxx</span>
<span style="border-radius:50%;border:dotted;display:inline-block;width:115001px">xxx</span>

Wrench yaml that demonstrates this is:

---
root:
  items:
    -
      bounds: [0, 0, 1000, 1000]
      type: "stacking-context"
      items:
       -
         bounds: [16, 16, 115001, 50]
         "clip-rect": [16, 16, 115001, 50]
         type: border
         width: 20
         "border-type": normal
         color: black
         style: dashed
         radius: [57500, 25]
---
root:
  items:
    -
      bounds: [0, 0, 1000, 1000]
      type: "stacking-context"
      items:
       -
         bounds: [16, 16, 115001, 50]
         "clip-rect": [16, 16, 115001, 50]
         type: border
         width: 20
         "border-type": normal
         color: black
         style: dotted
         radius: [57500, 25]
@kvark
Copy link
Member

@kvark kvark commented May 2, 2018

Showing (as in - cargo run -- show xxx.yaml) one of the YAMLs provided doesn't render any primitives for me

@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented Jun 4, 2018

This is somewhat mitigated by #2795 - which stores dashed / dotted borders in the texture cache, to be re-used across display lists and frames. We should still apply some optimizations to the number of pixels touched by drawing the dashes though.

@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented Feb 4, 2019

@nical added a patch which calculates a much tighter bounding rect for each dash / dot to draw into, so I believe this is resolved now.

@gw3583 gw3583 closed this Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.